-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
.mjs
fails webpack build
#493
Comments
@peterbakonyi05 This resolved it for me apollographql/react-apollo#1737 (comment) |
I used Would using only default import help with the problem? I.e., |
Thanks @f3ist, I didn't manage to find that in the official docs. In case anyone needs more info why the below solves the problem: webpack/webpack#6357
|
For what it's worth, you can also work around this issue more precisely by setting an
This is similar to the original solution of using |
You can see more about this issue here: node-fetch/node-fetch#493 (comment)
The
|
2.2.1 release should address this issue, if not please let me know. |
Signed-off-by: Jaid <jaid.jsx@gmail.com>
When using
node-fetch
withwebpack
v4.8.3
, bundling fails withnode-fetch
v2.2
. By default webpack will resolve themodule
entry frompackage.json
. Webpack supports.mjs
extension, it seems the problem is the ES6 imports from the built-innode_modules
likehttp
, which are being shipped in CommonJS format.Is there a plan to support webpack 4 with the new
.mjs
format?As a temporary workaround the issue can be solved by changing the mainFields entry to
mainFields: ["main", "module"]
. Note: this will affect all modules.Error:
The text was updated successfully, but these errors were encountered: