Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic and Amplify Storage GRAPHQL_AUTH_MODE Error

My current setup is: Ionic, Angular, AWS Amplify (GrapghQl, DynamoDB, Authenticator, and Storage)

I had everything working until I added Storage following the instructions here.

After I installed Storage and I tried running my app using Ionic Serve, I get the following error:

./node_modules/@aws-amplify/api-graphql/lib-esm/index.js:14:0-62 - Error: export 'GRAPHQL_AUTH_MODE' (reexported as 'GRAPHQL_AUTH_MODE') was not found in './types' (possible exports: GraphQLAuthError)

EDIT: when I use NPM Start, I can run the app no problem.

When I check the index.js file in ./types I can see export { GRAPHQL_AUTH_MODE };

I even reverted back to a previous commit and I still get this error.

Please let me know if I need to include more information.

Any ideas what I need to do to fix this?

like image 347
iamthestreets Avatar asked Jan 26 '26 09:01

iamthestreets


1 Answers

For anyone else who faces this issue, I was able to fix it by adding "allowedCommonJsDependencies": [] to my angular.json build options.

I was getting some warnings that I ignored and decided to go back and look at them closer and adding this fixed the issues. Moral of the story is sometimes you need to look at the warnings and not the errors.

like image 146
iamthestreets Avatar answered Jan 28 '26 23:01

iamthestreets



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!