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
Since the update tho, the api stopped working and returning a 500 error, caused by the following: Property 'appendHeader' does not exist on type 'NextApiResponse'.ts(2339)
This happened after upgrading the next package and simultaneously moving from npm to pnpm.
Link to the code that reproduces this issue
https://github.com/nicolascavallin/next-pages-firebase-auth-boilerplate/blob/main/src/pages/api/auth/session.ts
To Reproduce
## In API handler (Pages Router)
Set two cookies with
res.setHeader("Set-Cookie": [cookie1, cookie2])
Then: if you are running local (
pnpm dev
andpnpm build + pnpm start
), both cookies will be settled.Deploy to Vercel: call the same API, only first cookie will be settled.
If changes the order of cookies, then again, first will be settled (in Vercel).
In API route (App Router)
Set two cookies with
cookies()
Then: both cookies are settled in Vercel and in Local.
Current vs. Expected behavior
I expect to settled both cookies on Pages Router API.
Current (Vercel)
Current (Local with HTTPS)
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:49 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6020 Binaries: Node: 20.10.0 npm: 10.2.3 Yarn: 1.22.19 pnpm: 8.12.1 Relevant Packages: next: 14.1.4 eslint-config-next: 14.1.4 react: 18.2.0 react-dom: 18.2.0 typescript: 5.4.4 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure, Middleware / Edge (API routes, runtime)
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
I suspect a lot of things and play with all properties: httpOnly, secure, sameSite, priority.
Also, suspecting a "big size" of data, I just try to set simple cookies like:
foo1=bar1
andfoo2=bar2
.Always getting the same result, only first cookie settled.
Also I tried
And of course
And nothing.
I tried to get help from
cookies-next
library... nothing.I didn't found any solution and any similar issue, so I'm opening this one.
Thanks in advance.
The text was updated successfully, but these errors were encountered: