-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Upgrade to v7 stops module concatentation from working #8960
Comments
Hey @jacobwindsor! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
Module concatenation would have been disabled before I upgraded to babel 7 too. I hadn't disabled module transformation in the babel config. So, this might not be a babel issue but I'm unable to confirm whether it's a webpack issue. I'll leave it here in the hope that someone might have an idea. |
Not sure specifically, but maybe this is related to webpack/webpack#4039 (comment)? Are you compiling any CommonJS files in your project? If not, it's possible you're doing something else that Webpack doesn't expect. I'm not sure, I'd have to see the actual code that throws the error. |
Thanks for the tip @loganfsmyth Unfortunately, I can't share the code. It doesn't seem like our project is subject to any of those two conditions. We are only transpiling our source code and not node_modules and are using harmony imports/exports everywhere. The only thing I can think is that we have one file that contains many harmony imports and one require statement. The require statement is needed as it is importing a commonjs module. I have tried adding |
Can you try adding {
"presets": [["@babel/env", {
"targets": {
"browsers": ["last 2 versions", "ie >= 9"]
}
, "modules": false
, "useBuiltIns": "entry"
}]]
, "plugins": ["@babel/plugin-syntax-dynamic-import"]
} |
@danez That does not fix the issue. Still exactly the same problem. Why does this mean it;s a babel issue? |
If not transforming modules with Babel doesn't solve the issue, then it is a bug with webpack. |
Closed and moving to webpack repo |
v7 Regression
Potential Commit/PR that introduced the regression
I'm unsure if this is related to a change in babel or babel loader. I would guess babel but have been unable to find a PR related to it. However, PR #660 in babel-loader is related.
Describe the regression
When upgrading to babel 7, webpack's module concatenation does not behave correctly. Everything builds okay but results in a runtime error:
Disabling
optimization.concatenateModules
in the webpack production config fixes this.optimization.concatenateModules
is disabled by default in the development mode so this issue only arises in production.As expected from previously mentioned babel-loader PR, setting
modules
tocommonjs
in the babel config also fixes the issue.Both of the above fixes just force module concatenation to be disabled.
Babel Configuration (.babelrc, package.json, cli command)
Expected behavior/code
Webpack's module concatenation should behave as expected with Babel 7.
Environment
The text was updated successfully, but these errors were encountered: