Search code examples
angularionic-frameworkaws-amplifyionic6

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?


Solution

  • 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.