-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NextAuth v5 TypeError: next_dist_server_web_exports_next_request__WEBPACK_IMPORTED_MODULE_0__ is not a constructor
#9922
Comments
The problem seems to be caused by
Which is why setting either |
This comment was marked as off-topic.
This comment was marked as off-topic.
Related to #9795. This sounds like an upstream Next.js bug which I thought has been fixed. Will have a look there. The workaround is to patch Note: You most likely don't need |
Ah, good to know. |
Fix is on the way in Next.js vercel/next.js#61721 |
Will close this issue, as it has been fixed in the latest NextJS canary release. |
Thing is, I do use a proxy because I am working with a Docker container and using nginx to deploy the app. What are my options in this case? EDIT: Nevermind my message, I was able to make the auth work using NEXTAUTH_URL_INTERNAL instead. |
Hi @Zelzazor , can you please tell me how you were able to make the auth work using NEXTAUTH_URL_INTERNAL, thanks. |
I was able to apply a fix for local dev at least by changing:
to
in my .env file. If you don't have AUTH_URL perhaps add NEXTAUTH_URL_INTERNAL instead of replacing |
Thanks, btw my error resolved when i shifted to previous version 5.0.0-beta.4 from 5.0.0-beta.8 |
I am still getting this error. I tried adding AUTH_URL , NEXTAUTH_URL_INTERNAL and still keep getting this error. |
@bwheeele This is an upstream Next.js bug, which has been fixed in vercel/next.js#61721, and landed in the latest Next.js canary version, but yet to be landed in the stable version. |
@chungweileong94 just installed |
I've encountered a potential edge case when using the prisma adapter together with prisma accelerate and the following versions in my project: @prisma/client: ^5.10.2 I observed that this issue was resolved when I set the route handler to run on the edge. This doesn't work:
This works:
|
This is what fixed it for me on |
God, bless you! Thanks a million. |
I am on 4.2.5 and nor AUTH_URL nor NEXTAUTH_URL_INTERNAL solved it for me. |
Not at all, if youremove them and try authenticating with Google, you get an url_mismatch error. |
Environment
Reproduction URL
https://github.com/chungweileong94/nextauth-route-handler-error
Describe the issue
If one of the
AUTH_URL
andNEXTAUTH_URL
is set, we will get the following error.How to reproduce
pnpm dev
http://localhost:3000/api/auth/signin
Expected behavior
It should show the next-auth built-in sign-in page. Instead, it shows throw 500 error (
TypeError: next_dist_server_web_exports_next_request__WEBPACK_IMPORTED_MODULE_0__ is not a constructor
)The text was updated successfully, but these errors were encountered: