Webpack 5 support. ESM strict mode
See original GitHub issueSee: https://github.com/babel/babel/issues/12058
Webpack 5 has enabled strict mode on the ESM modules imports. As a result when using react-select in our project and compiling with Webpack 5 produces errors such as
Module not found: Error: Can't resolve './iterableToArray' in '/Users/thomaswelton/Projects/justpark-web/node_modules/react-select/node_modules/@babel/runtime/helpers/esm'nDid you mean 'iterableToArray.js'?nBREAKING CHANGE: The request './iterableToArray' failed to resolve only because it was resolved as fully specifiedn(probably because the origin is a '*.mjs' file or a '*.js' file where the package.json contains '"type": "module"').nThe extension in the request is mandatory for it to be fully specified.nAdd the extension to the request.
This has been fixed in babel 7.12.0
I will submit a PR to bump @babel/runtime
to 7.12.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:13
- Comments:11
(Note I’m also working on getting the PR through in order to avoid the situation altogether. Hopefully we can include the fix in the next release.)
That worked out, and I can confirm the entries for
@babel/runtime
are now consolidated. Thanks very much for your help, that’s a great generalizable tip.Before:
After: