Open cody-dot-js opened 1 week ago
Looks like it's a bug w/ remix single fetch on vercel!
Repro here: https://github.com/cody-dot-js/remix-vercel-set-cookie-repro/pull/1
Deploy: https://remix-vercel-set-cookie-rep-git-fcb2b2-codyjs-projects-9c03697f.vercel.app/
Thanks for the repro. I can confirm this is currently an issue on Vercel when using the Node.js native Headers
(which is indeed the case with singleFetch). We are looking into it.
I am noticing that when I run remix vite locally with single fetch, I can return multiple
Set-Cookie
headers in actions and loaders. If I do something like:I see all three
Set-Cookie
headers sent to the browser.However, when deployed to vercel, only the last
Set-Cookie
header"ccc=1"
is sent to the browser! I am not sure at this time if it's a purely vercel serverless runtime bug or a wombo combo with vercel + remix vite + single-fetch.I am using node 20 lts and the latest versions of remix, vite, and the vercel preset.
I am working on producing a minimal repro case for y'all and will update this issue when I have one. I will also investigate if it's a problem with the classic remix compiler and remix vite without single fetch enabled.
EDIT: Reproduction repo: https://github.com/cody-dot-js/remix-vercel-set-cookie-repro Reproduction deployment: https://remix-vercel-set-cookie-repro.vercel.app/
Expectation: I see three cookies set when I visit the index page of this app:
aaa=loader
,bbb=loader
, andccc=loader
.I see three
Set-Cookie
headers in the network tab for the action response.Reality: Locally, I see the three cookies. However, in the vercel deployment, I only see the last cookie
ccc=loader
Screenshots: