-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
ra-data-graphql broken with enabled mangle in Webpack #1640
Comments
ping @djhi I can't reproduce this one, can you take a look? |
Ran into the same issue. It happens because ra-data-graphql has a direct dependency on graphql. If you have installed graphql with a different version also in your main project you will get 2 versions in your final build an this error occurs. "resolutions": { Also maybe the react-admin Team could make graphql a peer dependency instead. |
I ran into the same issue though only having one version of graphql. Using react-create-app and react-admin:
Tried using the resolutions directive in package.json, and it didn't help, and my guess is that it is due to the fact that I only have one version of graphql. Not sure if making graphql a peer dependency of ra-data-graphql would work better as it will still one version of graphql, but the main project will decide which version that would be. |
Fixed by #1719 |
What you were expecting:
When I build project for production(react-scripts build or build with Webpack with enabled mangling in Uglify plugin) project is working
What happened instead:
Page loads with console error:
`Uncaught Error: Cannot use e "__Schema" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.`
Steps to reproduce:
npm run build
npx http-server build
Related code:
Developers of graphql-js respond here that issue is fixed in 0.13/0.13.1 version
Environment
The text was updated successfully, but these errors were encountered: