You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 into middlware.ts it throws the following error
I don't know if it is because auth itself of because the use of next-auth that returns auth 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 run pnpm 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:
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
I had the same issue with next-intl and now next-auth, but it seems the latest canary release has a fix for both of these issues, see the fix. It works fine for me at least now.
I had the same issue with next-intl and now next-auth, but it seems the latest canary release has a fix for both of these issues, see the fix. It works fine for me at least now.
Closed as this isn't an issue with next-auth, thanks @Gawdfrey for pointing it out.
I had the same issue with next-intl and now next-auth, but it seems the latest canary release has a fix for both of these issues, see the fix. It works fine for me at least now.
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: