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
Webpack5 ESM strict mode #12058
Comments
Hey @ocdi! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
btw this is not an webpack-only error. If you run
|
True, this is causing my issue:
|
Duplicate of #8462 |
This issue will be fixed by #10853, please leave a review comment there, thanks. |
@JLHwung Can we prioritize the problem? |
@evilebottnawi I will ship it asap once that PR is approved. Can you leave a review? |
Webpack 5 is now released so this would be good to release asap as many people will run into it now |
Indeed. Came here via Google. Ran into it right away. Guess I won't remain the only one. Affected modules:
Any hints on how I can solve this? I see a merged PR from 26 days ago but it was for Next.js, not for Babel. |
We plan to release 7.12, which fixes this issue, the upcoming week. |
same problem here any workaround available before Release? |
@arpu the package mentioned here might help #8462 (comment) |
@arpu till then you can add rule for resolving those modules |
babel 7.12.0 resolved the errors with webpack v5. nice. |
Bug Report
Webpack5
beta.30
has enabled strict mode on the ESM modules imports https://github.com/webpack/webpack/releases/tag/v5.0.0-beta.30webpack/webpack#11467 has noted people with code problems, however
@babel/runtime
appears to have code that doesn't follow the strict"type": "module"
requirements, as expected for node / webpack..\node_modules\@babel\runtime\helpers\esm\package.json
has"type": "module"
being set and libraries that depend on@babel/runtime
with ESM modules are broken as a result.I expect the code generator should be outputting with the file extensions to satisfy the requirements of ESM modules
https://nodejs.org/api/esm.html#esm_differences_between_es_modules_and_commonjs
Current behavior
@babel/runtime/helpers/esm/*.js contains extensionless imports for dependencies.
Expected behavior
@babel/runtime/helpers/esm/*.js to contain fully specified extensions for imports
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
N/A - this is npm published module
Environment
The text was updated successfully, but these errors were encountered: