Getting realm related error in console if using webpack.UglifyJsPlugin
See original GitHub issueHello,
I have a bit strange situation. If I build my project with UglifyJsPlugin I get this 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.
https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
I checked node_modules and I have only one graphql
module installed and during development, I don’t have this error. Moreover, my app still works fine and makes requests.
When I debug instanceOf
I see something like this:
arguments[1].toString();
"function e(t){r(this,e),this.name=t.name,this.description=t.description,this.astNode=t.astNode,this._scalarConfig=t,"string"!=typeof t.name&&Object(Y.a)(0,"Must provide name."),"function"!=typeof t.serialize&&Object(Y.a)(0,this.name+' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.'),(t.parseValue||t.parseLiteral)&&("function"!=typeof t.parseValue||"function"!=typeof t.parseLiteral)&&Object(Y.a)(0,this.name+' must provide both "parseValue" and "parseLiteral" functions.')}"
arguments[0].constructor.toString()
"function e(t){r(this,e),this.name=t.name,this.description=t.description,this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes,this.isTypeOf=t.isTypeOf,this._typeConfig=t,"string"!=typeof t.name&&Object(Y.a)(0,"Must provide name."),t.isTypeOf&&"function"!=typeof t.isTypeOf&&Object(Y.a)(0,this.name+' must provide "isTypeOf" as a function.')}"
Any ideas what it could be and how to avoid it?
Versions:
"graphql": "^0.12.3",
"webpack": "^3.8.1",
"webpack-dev-server": "^2.9.4",
Thanks, and btw, Happy New Year!
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Remove console.logs with Webpack & Uglify - Stack Overflow
My understanding is that I can use standalone Uglify lib to get all the options, but I don't know which one? The problem...
Read more >webpack/webpack - lib/mappings.wasm - Gitter
Hi All, Material fonts are not loaded when used offline. I am trying to use material-design-icons npm package and use material-icons offline.
Read more >UglifyjsWebpackPlugin | webpack
This plugin uses uglify-js to minify your JavaScript. Requirements. This module requires a minimum of Node v6.9.0 and Webpack v4.0.0. Getting Started.
Read more >Web Development with Node and Express - Van Meegern
lackluster console support, consider using a Linux VM for development. If you find the. 10 | Chapter 2: Getting Started with Node ...
Read more >Front-End Performance Checklist 2021 (PDF, Apple Pages ...
To get accurate results and goals though, make sure to first get a thorough picture of your users' experience by studying your analytics....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am using
0.13.2
and I still see this error.Please re-open. Working with graphql on the client (with an RN project managed by expo) we don’t have
NODE_ENV
set, naturally, and getting this error when building the project, which causes the whole thing to crash. I don’t know what the source of the issue this check is for, but isn’t there something else you can check for, instead ofNODE_ENV
?