Skip to content
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

TypeError: e.getSetCookie is not a function #56947

Closed
1 task done
grzegorzpokorski opened this issue Oct 17, 2023 · 14 comments
Closed
1 task done

TypeError: e.getSetCookie is not a function #56947

grzegorzpokorski opened this issue Oct 17, 2023 · 14 comments
Labels
bug Issue was opened via the bug report template.

Comments

@grzegorzpokorski
Copy link

Link to the code that reproduces this issue

https://github.com/grzegorzpokorski/nextjs-getsetcookie-error

To Reproduce

  1. clone repo
  2. pnpm i
  3. pnpm dev
  4. open localhost:3000 in browser
  5. should occur error

Current vs. Expected behavior

error should not occur

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023
Binaries:
  Node: 18.11.0
  npm: 8.19.2
  Yarn: 1.22.19
  pnpm: 8.9.2
Relevant Packages:
  next: 13.5.6-canary.2
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Additional context

No response

@grzegorzpokorski grzegorzpokorski added the bug Issue was opened via the bug report template. label Oct 17, 2023
@ze-kel
Copy link

ze-kel commented Oct 17, 2023

Just wanted to open this. Breaked lucia-auth in my project.

I also digged a bit more and discovered that this issue is not preset when using Node v16, while being present on Node Stable(v19.3.0).

Codesandbox with it working on Node 16.

@huozhi
Copy link
Member

huozhi commented Oct 17, 2023

I can repro this with node 18.11, you can upgrade your nodejs version 18.16 it will fix the problem

@zfreiter
Copy link

zfreiter commented Oct 17, 2023

I think I have a similar issue -> TypeError: responseHeaders.getSetCookie is not a function.
Today was my first time creating a Nextjs app. I have Node v18.18.2 and I had the most current NextJS version for the basic start for a NextJS application. When I change the NextJS to version 13.5.4 the error goes away.

@grzegorzpokorski
Copy link
Author

grzegorzpokorski commented Oct 17, 2023

@huozhi you have right! Upgrading Node.js to 18.16.1 resolved issue. App also successfully builds on Vercel ❤

@jawkhan
Copy link

jawkhan commented Oct 17, 2023

I experienced this error after upgrading NextJS to 13.5.5. Upgrading to the latest version of node worked for me. I had version 19.1.0 and upgraded to version 21.0.0.

I used node version manager (nvm) and ran the following command to get the latest version of node installed:
nvm install node

You can follow these instructions to install nvm:
https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/

@abdolrhman
Copy link

upgrade fix the issue, use latest node --v v18.18.2

@MuhammadAli-123
Copy link

Yes, After Upgrading the Node Version to Latest will solve this problem.

@brob
Copy link

brob commented Oct 18, 2023

I've tried Node versions 18.18.2, 19.0.0, 21.0.0 and have this issue with both draftMode().enable() and cookies().set(). Are there other workarounds?

@huozhi
Copy link
Member

huozhi commented Oct 18, 2023

We patched a fix https://github.com/vercel/next.js/releases/tag/v13.5.6, please upgrade to the new version

@8ctopotamus
Copy link

Next 13.5.6 worked for me! Running Node 18.12.

@goudete
Copy link

goudete commented Oct 21, 2023

I can repro this with node 18.11, you can upgrade your nodejs version 18.16 it will fix the problem

This worked for me. THANK YOU!

@Matdweb
Copy link

Matdweb commented Oct 25, 2023

It also worked for me! And I am running node 20.9.0!
But It would be great to put this in the documentation because it took me a while to get to this Issue and I had no idea 😢

@Matdweb
Copy link

Matdweb commented Oct 25, 2023

It also worked for me! And I am running node 20.9.0! But It would be great to put this in the documentation because it took me a while to get to this Issue and I had no idea 😢

I actually encountered issues with API routes in Next.js 13, and it was quite challenging because they didn't work at all, and I had no idea why.
But with this is, it is finally resolved 😄

@huozhi
Copy link
Member

huozhi commented Oct 25, 2023

If you're running 13.5.6, the allowed engine versions of node.js should be fine

#56947 (comment)

@vercel vercel locked as resolved and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests