-
Notifications
You must be signed in to change notification settings - Fork 2.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
GraphQL error - Cannot use e "__Schema" from another module or realm. #1445
Comments
Hi @vivekFAGH , Thanks for reporting this. Have you updated either your version of GraphQL or your version of Amplify recently? That's not a suggestion - just trying to get more info. |
I do not have any other version of graphql, but yes, I have been trying to upgrade amplify from 0.4.8 to 1.0.x without success. A clean install of the app after clearing cache still results in this error. If it helps, the only way i do not see this error after installing version 1.0.5, or 1.0.6, is by excluding the minifyjs flag, So, ionic cordova build android --prod --release Building without the --prod flag but, this works as expected: |
I get the same issue with ionic 3, aws-amplify 1.0.6 and aws-amplify-angular 1.0.4-unstable.2 see #1003 The issue was reported as closed with 1.0.4-unstable.0, but I think that's only with ionic 4. The problem still persists in ionic 3 |
I have since tested this with earlier versions of amplify ( upto 1.0.3) and ionic app scripts, its still a problem. |
I have been able to get around the issue by using the modular imports of amplify, rather than importing the entire amplify service. |
I am using module imports as well, but still see the error. Any related changes you had to make? |
@johneast I saw your other post about how you resolved the error. I am using the API import in my code which has a dependency on graphql. |
I am also seeing this error, and also using the API import, so need a different solution. Using Is it perhaps possible to exclude only the aws-amplify module from minification? |
I'm also facing this issue. I tried aws-amplify 1.0.8 and aws-amplify-angular 2.0.0 and it still doesn't work. I did some digging in my node_modules folder and I found that AWS Amplify defines graphql version 0.11.7 in its package-lock.json file (node_modules/aws-amplify/package-lock.json) but the API module uses 0.13.0 in its package.json file (node_modules/@aws-amplify/api/package.json). That might be the problem. Still haven't found a solution... Any other information/suggestion is appreciated :) |
I have the same issue. We're using Amplify 1.0.8 and Expo/React Native, and when starting Expo with --minify option, we get the same error in the simulator. It works fine if it's not minified. We're also including the API module, which depends on GraphQL. |
Same here for latest Ionic 3.9.2 and Angular 5.2.11. Building with --minifyjs flag leads to mentioned error. Current build environment for reference:
|
Any news on this issue? Still having problems with ionic 3 when building prod builds. I'm using aws-amplify version 1.1.4 and aws-amplify-angular version 2.0.7 |
the problem is caused by graphql/graphql-js#1182 - currently suggested solution is to use As I experience same issue with my own Ionic project, for now I downgraded |
Stuck here... Downgrade to 0.11.7 didn't help. Any ideas? |
@ciekawy - I actually experienced some success with the NODE_ENV=production solution (at least on an emulator). |
This is realted to #2275 . In troubleshooting that issue, I was able to reproduce the error with two combinations of build arguments, and fix both of them by prepending
You might also need to put the following into your package.json:
|
For anyone experiencing this problem and finding that setting NODE_ENV when running ionic build like |
I have same issue when NODE_ENV is NOT 'production'. "resolutions": {
"graphql": "0.11.7"
}, |
I just got this same error, but I'm not using Ionic. I am using Parcel along with these dependencies in my
Would it be possible to reopen the issue? Setting |
I am facing this issue. |
Same problem on an Expo app and using |
just |
Just submitted this |
I've had this problem for AGES. Using |
I ran into this problem as well. I created a new amplify app through CloudFormation with the same name property as an existing app. The new app (despite the duplicate name) showed up within Amplify and was able to provision/build/deploy it, but ran into the aforementioned error. Deleting the new app from Amplify and redeploying with a new name within CloudFormation fixed the issue for me |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Do you want to request a feature or report a bug?
Maybe a bug
What is the current behavior?
Using a ionic 3 app and amplify 1.0.5 on android and ios. I get the following graphql error:
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.
at t.a (vendor.js:1)
at h (vendor.js:1)
at l (vendor.js:1)
at F (vendor.js:1)
at q (vendor.js:1)
at new u (vendor.js:1)
at u (vendor.js:1)
at Object. (vendor.js:1)
at t (vendor.js:1)
at Object. (vendor.js:1)
I checked and do not see any other graphql version installed. A debug build works as expected, while a release build with ionic cli 3.2 does not work and results in a white screen with the error above.
npm ls graphql
\ionic\myapp
-- [email protected]
-- @aws-amplify/[email protected]`-- [email protected]
Anyone else see this?
The text was updated successfully, but these errors were encountered: