This repository has been archived by the owner on May 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Browser builds with node polyfills does not work with .mjs files #427
Labels
Comments
Looks like webpack/webpack#7032 |
I see this issue too when trying to use Example:
causes
|
We're going to work on this soon. What version of graphql are you using? I think that particular issue should be resolved in [email protected]. |
@KevinGrandon you a re quite right, adding a resolution to my package.json for 14.0.0 resolved the issue for now.
I was using the version specified by react-apollo which I believe is |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Browser builds with node polyfills does not work with .mjs files
Type of issue
Bug
Description
If a browser file has an
.mjs
extension and uses a node builtin (e.g. process), and the project has the process polyfill configured, the compiled code will referencerequire
rather than__webpack_require__
. This causes an uncaught exception in the browser sincerequire
is not defined.NOTE: There are likely many other issues with
.mjs
files. We should take verify that other aspects of the build process work with.mjs
files.Current behavior
Generates code using require:
Expected behavior
Should generate code using webpack_require:
Steps to reproduce
test.mjs
with the following contentssrc/main.js
fusion dev
The text was updated successfully, but these errors were encountered: