Describe the bug
GraphQLError: adapter is not a function
at APIClass.
at step (/Users/ryanmalesic/Projects/tdee-online/node_modules/@aws-amplify/api/dist/aws-amplify-api.js:4733:19)
at Object.throw (/Users/ryanmalesic/Projects/tdee-online/node_modules/@aws-amplify/api/dist/aws-amplify-api.js:4663:14)
at rejected (/Users/ryanmalesic/Projects/tdee-online/node_modules/@aws-amplify/api/dist/aws-amplify-api.js:4625:32)
at runMicrotasks (
at processTicksAndRejections (interna
To Reproduce
Steps to reproduce the behavior:
Query in getinitialProps of a nextjs app
Expected behavior
It should query, not throw
Doing more stack tracing, this seems to be an axios issue. I have put a discussion in there. I will close this if an axios fix can correct the issue
Hey @ryanmalesic, is there an issue open to track the axios discussion?
Hey @ryanmalesic, is there an issue open to track the axios discussion?
@jordanranz
https://github.com/axios/axios/issues/2507
Any updates? I ran into this issue too
Is the change in 1.2.4 already? I ran into the same issue while using 1.2.4 today.
Still having this issue with @aws-amplify/[email protected] on server side. Axios issue is closed, I don't know if it is related to amplify or axios.
Getting the same error with Next.js and [email protected].
From https://github.com/axios/axios/issues/2507#issuecomment-549415995, this looks to be an @aws-amplify/api issue.
Not seeing a workaround. Spent the day getting a Next.js project up only to hit this issue. 馃檭
CC @jordanranz
I got rid of the error using what I needed from. https://github.com/aws-amplify/amplify-js/issues/4305#issuecomment-552193872
@simpleshadow, thanks for the tip, I got it working by locking down the versions with resolutions as well.
Getting the same error with a Nuxt.js application after trying to upgrade aws-amplify to the latest (^2.2.1)
Please Amplify-JS team, show a little more love for SSR frameworks, they shouldn't be treated like afterthoughts.
Forgot to mention that I get this error with express.js. it's not related to a specific ssr framework.
I think I know the root cause. NuxtJs/NextJs are consuming the amplify library using the main field and not the modules field. Currently main field points to a webpack umd build which obviously shims the process variable preventing axios to determine the right environment.
I'll look into changing the main field to point to a cjs modules entry point.
Anyone knows if there is a way for Nuxt/NextJs apps to read the modules field in library's package.json instead of main?
@ryanmalesic @weizliu @aliankarali @lambda0xff @simpleshadow We have just merged in the fix. Can you please try with aws-amplify@unstable version and let us know if it's fixing the issue?
Seems to fix the issue for me.
aws-amplify": "^2.2.1-unstable.21
Yes, it seems like it resolved the issue @Amplifiyer .
Most helpful comment
@ryanmalesic @weizliu @aliankarali @lambda0xff @simpleshadow We have just merged in the fix. Can you please try with aws-amplify@unstable version and let us know if it's fixing the issue?