-
-
Notifications
You must be signed in to change notification settings - Fork 145
Webpack complains about strict ESM module and requires import clause with .js suffix #731
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
Nvm, I think 4.23.11 caused the issue. I think I initially got the error because I rebuilt my package and somehow that got updated to the latest version. Here is a sandbox https://codesandbox.io/p/github/Shellishack/webpack-esm-sandbox/chore/template_sync_8bcf577?import=true |
Same issue, definitely started with update from 4.23.10 to 4.23.11 |
Could you please let us know when the fix will be available and version 4.23.12 will be released? |
For the same problem, when I downgraded the package version to 4.23.10, this kind of problem didn't occur. I checked the "esm" folder in its output. In version 4.23.11, there was an additional "package.json" file, which declared "type: 'module'". This enabled the ESM strict mode and led to this problem. |
Yesterday when I discovered this issue I also found #710 (which is way older), and hoped I could bend webpack to do the same aliasing/importing, but without any luck. It's mind boggling such change happens just within patch 😓 |
Hi, After reviewing the code, and changes in #729, it seems like there were attempts to distinguish esm and cjs by adding I think I found a potential fix by adding a The new
Now when I run I don't know if this cover all cases. I am happy to create a PR when I get more time |
Hi,
Thanks for the community's hard work on solving issues around ESM/CJS interpretation.
I noticed these build errors on my side since
@uiw/react-codemirror4.23.10
. Updating to 4.23.11 to adapt #729 doesn't seem to solve the problem. I am using Webpack along with React and ESM.Workaround:
As #680 (comment) pointed out, rolling back to 4.23.8 worked for me.
I am happy to help, but I am reletively new to this community so please enlighten me if devs can look into this. A possible direction to look into might be some bugs introduced between 4.23.8 to 4.23.10
The text was updated successfully, but these errors were encountered: