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?

gefragt vor 2 Jahren76 Aufrufe
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen