Closed vivekFAGH closed 5 years ago
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 ---- Does not work
Building without the --prod flag ionic cordova build android --aot --uglifyjs --minifyjs--minifycss --optimizeJs --release -- Does not work
but, this works as expected: ionic cordova build android --aot --uglifyjs --minifycss --optimizeJs --release
I get the same issue with ionic 3, aws-amplify 1.0.6 and aws-amplify-angular 1.0.4-unstable.2 see https://github.com/aws-amplify/amplify-js/issues/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 --aot --uglifyjs --minifycss --optimizeJs
works, but the output is significantly bigger.
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:
Ionic:
ionic (Ionic CLI) : 4.1.2
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.1.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-webview 2.1.4, (and 13 other plugins)
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
NodeJS : v10.7.0
npm : 6.4.1
OS : macOS High Sierra
Xcode : Xcode 9.3.1 Build version 9E501
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 https://github.com/graphql/graphql-js/issues/1182 - currently suggested solution is to use NODE_ENV=production
which does not make sense for mobile app as this is a static bundle served from a device filesystem. I recommend to put a comment in graphql-js
ticket or open a new one.
As I experience same issue with my own Ionic project, for now I downgraded graphql
to v 0.11.7 and the issue is gone.
the problem is caused by graphql/graphql-js#1182 - currently suggested solution is to use
NODE_ENV=production
which does not make sense for mobile app as this is a static bundle served from a device filesystem. I recommend to put a comment ingraphql-js
ticket or open a new one.As I experience same issue with my own Ionic project, for now I downgraded
graphql
to v 0.11.7 and the issue is gone.
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 NODE_ENV=production
, i.e.
NODE_ENV=production ionic cordova run android --prod --device
NODE_ENV=production ionic cordova run android --aot --uglifyjs --minifyjs --minifycss --optimizeJs --device
You might also need to put the following into your package.json:
"resolutions": {
"graphql": "0.13.0"
},
For anyone experiencing this problem and finding that setting NODE_ENV when running ionic build like NODE_ENV=production ionic build --prod
doesn't work, you can fix this by using webpack to inject process.env.NODE_ENV into the build package. I wrote up how I did this here - https://gist.github.com/jmannau/8039787e29190f751aa971b4a91a8901
I have same issue when NODE_ENV is NOT 'production'.
I'm not sure, but I can fix it by downgrading graphql
to 0.11.7
.
"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 package.json
:
"dependencies": {
"@workpop/graphql-proxy": "^2.4.0",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"graphql-playground-middleware-express": "^1.7.18",
},
Would it be possible to reopen the issue? Setting NODE_ENV=production
did not work for me 😭
I am facing this issue. I used amplify in my react web app, not used graphql. Please help me.
Same problem on an Expo app and using NODE_ENV=production
solves it
just NODE_ENV=production
has very little sense for ionic app loaded directly from mobile device :D
Just submitted this graphql-js
PR to solve this problem in non-production environments where minification is enabled (such as NODE_ENV=staging
). Please have a look!
I've had this problem for AGES. Using NODE_ENV=production
is not a good solution, since we have separate endpoints for each environment and we didn't want to mess up the metrics. Then I removed devtool: 'source-map'
from configureWebpack
(we use Vue) and the problem was gone. Maybe that helps someone.
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 *-help
channels or Discussions for those types of questions.
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
-- aws-amplify@1.0.5
-- @aws-amplify/api@1.0.5 `-- graphql@0.13.0Anyone else see this?