-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Webpacker 6.0.0.beta2 - Module not found: Error: Can't resolve modules with jsx extension. #2861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@storm2513 What's in your Curious since I want to make sure I understand how it was working for you in v5. |
@rossta
In v6 I haven't changed generated
|
@storm2513 Thanks, that's helpful. Looks like in v5, you had The extensions used to be passed to webpack's webpacker/package/environments/base.js Lines 93 to 94 in 1aca8aa
As a workaround, you can add back support by modifying your webpack config directly using the special // config/webpack/base.js
const { webpackConfig, merge } = require('@rails/webpacker')`
module.exports = merge(webpackConfig, {
resolve: {
extensions: ['.jsx']
}
}) I believe this should combine the default There's a case to be made to updating the defaults as well, but you should be able to use this workaround for now. |
@rossta thank you! Worked like a charm! |
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to migrate from webpacker v5 to v6.
I've faced this issue with jsx modules:
Webpack error:
packs/common.js
javascripts/common/index
If I change it to
import renderHeader from '../header/index.jsx';
it loads correctly.Issue is present with all
.jsx
files.import something from file
doesn't work,import something from file.jsx
seems to work.What am I missing?
The text was updated successfully, but these errors were encountered: