-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Next-Auth not working with Next.js latest v13.4.13: TypeError: cookie is not iterable #8315
Comments
This comment was marked as spam.
This comment was marked as spam.
@balazsorban44 Interesting... If you selectively install next v13.4.13 with Here's the output I got from following my reproduction steps on a different device than the one in the environment section: Update: Interestingly enough, I reverted back to 13.14.12, deleted node_modules and installed next@latest, and it seemed to work. Nonetheless, this seems to be a circumstantial issue that doesn't consistently happen. Does this seem like something to bat an eye to? |
Try upgrading node |
Same - upgrading to 18.17.1 worked for me |
I also had the same issue with next.js 13.4.17, and I had tried different version of nodejs (both 18.17.1 and 19.6.1), but diden't work for me. I finally change my next.js to version 13.4.12, and the issue has magically gone. |
Upgrading NodeJS to @yarrichar Thank you! |
Thank you @yarrichar |
Next v13.4.19 - Node 19.6.1, does not work. |
Next v13.4.19 - Node v19.6.1 does not work |
Next v13.4.19 - Node v18.14.1 does not work |
Next-Auth v4.24.4 is now ok to install on Next v14.0.0, well done guys! |
thanks for telling us, will try it out. good luck ! |
Environment
System:
OS: Windows 10 10.0.19045
CPU: (12) x64 AMD Ryzen 5 3600X 6-Core Processor
Memory: 5.74 GB / 15.91 GB
Binaries:
Node: 18.14.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.5.0 - ~\AppData\Roaming\npm\npm.CMD
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (115.0.1901.203)
Internet Explorer: 11.0.19041.1566
Reproduction URL
https://github.com/brandon-kong/next-auth-next-test
Describe the issue
The latest version of Next-Auth as of August 13, 2023 is not compatible with Next.js v13.4.13. When attempting to go to
/api/auth/signin
OR use Next-Auth's session functions likegetServerSession
,signIn
,getSession
, etc..., the server output dumps:TypeError: cookies is not iterable at node:internal/deps/undici/undici:1865:43 at Headers Iterator.next (node:internal/deps/undici/undici:1108:26)
I have tried:
As soon as I reverted Next.js' version to 13.4.12, the preceding version of the latest, Next-Auth worked again.
An easy way to avoid this issue is to just not use Next.js v13.4.13. However, it is likely that future updates to Next.js will not be compatible with Next-Auth as well.
How to reproduce
create-next-app
version which will initialize a 13.4.13 project (as of this issue's creation). Note that using the App Router or Page Router will not matter.npm i next-auth
npm run dev
and navigate tohttp://localhost:3000/api/auth/signin
.500 Internal Error
will be displayed on the screen, and theTypeError
mentioned in the title and in the issue brief will be displayed in the server console.Additionally, you could also clone the next-auth-example repository: https://github.com/nextauthjs/next-auth-example
After running
npm install
andnpm run dev
and attempting to use next-auth, you will come across the same error.Expected behavior
Visiting
/api/auth/signin
should display the default Next-Auth sign-in page will all the provider forms for signing in.The text was updated successfully, but these errors were encountered: