Skip to content

Commit f603c56

Browse files
justin808claude
andcommitted
Pin @babel/preset-react to v7 in generator e2e template
The generator specs' react e2e template installed @babel/preset-react with no version constraint. @babel/preset-react@8 was published requiring @babel/core ^8 as a peer, but Shakapacker's generated app uses @babel/core ^7. npm therefore resolved the unpinned add to v8 and failed with ERESOLVE, which aborted the whole `npm add` and left react and react-dom uninstalled. The subsequent bin/shakapacker build then failed with "Module not found: Can't resolve 'react'", breaking the Generator specs job on main and every PR. Pin to @babel/preset-react@^7 to match the app's @babel/core ^7, matching the existing pin already used in spec/dummy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 81b5634 commit f603c56

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

spec/generator_specs/e2e_template/template.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
package_json = PackageJson.new
66

77
# install react
8-
package_json.manager.add(["react", "react-dom", "@babel/preset-react@^7.17.0"])
8+
# Align with spec/dummy; React 18 and Babel 7 match this template's app stack.
9+
package_json.manager.add([
10+
"react@^18.3.1",
11+
"react-dom@^18.3.1",
12+
"@babel/preset-react@^7.18.6"
13+
])
914

1015
# update webpack presets for react
1116
package_json.merge! do |pj|

0 commit comments

Comments
 (0)