-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
v5 Beta does not work with Next 15 RC (React 19 RC) - Middleware issue #11006
Comments
Aralf
added
bug
Something isn't working
triage
Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
labels
May 24, 2024
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Reproduction URL
https://github.com/Aralf/next-intl-react-19-compiler/tree/authjs-v5
Describe the issue
The issue is related to this change vercel/next.js#65424 where in case we import something from react it will only import server related api and giving error for client apis.
I had a reproduction repository that uses next-intl and next-auth v4 as I had initially raised this issue with next-intl amannn/next-intl#1075
The root cause was found amannn/next-intl#1075 (comment) and after applying the suggested change everything got resolved.
But the issue still persisted in another project where I use v5 instead. So I made the a new branch (the one I provide as reproduction) where I have updated to v5 and sure enough a face the same issue.
When import the universal
auth
intomiddlware.ts
it throws the following errorI don't know if it is because
auth
itself of because the use ofnext-auth
that returnsauth
along with the handlers, signIn, signOut, etc. and everything is exported from the same file. As the issue on next-intl was because of importing the file where their navigation solution (that used next/link internally ) was also exported, I assume something similar is happening here.How to reproduce
Make sure you are on the branch
authjs-v5
and runpnpm install
&pnpm dev
. Application will crash from the start.You can then try with
main
where next-auth v4 is used and see that the application runs fine.Expected behavior
It should work with Next 15 & React 19
The text was updated successfully, but these errors were encountered: