aws-appsync package breaks create-react-app

0

I'm trying to implement Cognito User Pools in my Amplify app via this example (https://docs.amplify.aws/lib/graphqlapi/authz/q/platform/js/#cognito-user-pools). Importing the 'aws-appsync' package yields several errors like:

ERROR in ./node_modules/graphql/index.mjs 25:0-49

Module not found: Error: Can't resolve './version' in 'C:\Users\...\node_modules\graphql'
Did you mean 'version.mjs'?
BREAKING CHANGE: The request './version' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

I can address this with webpack config, but I'd have to eject my entire app from Create React App OR go the craco/react-app-rewired route. Surely there's an easier way?

asked 2 years ago74 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions