Open otoxiep95 opened 2 weeks ago
I think this is intentional. Have a look at this PR: https://github.com/vercel/next.js/pull/67779 where they assume the draft mode is active when the env
is development
and the cookie value is development-id
when running in edge
runtime.
Quoting the author of the PR:
So we do a fallback check for dev mode if the cookie is present and preview id is development-id then we still treat it as draft mode is enabled.
In my testing with the repository @otoxiep95 has opened above, this is not true - sure, the cookie gets set with this static value, but:
Thank you for posting the link to the related PR @abhi12299 , sounds like it was recently merged so perhaps it is an issue that will be solved through the v15 rc
Link to the code that reproduces this issue
https://github.com/otoxiep95/next-draft-edge-issue-reproduction
To Reproduce
npm install
npm run dev
http://localhost:3000/api
app/api/route.ts
and removeexport const runtime = "edge";
Current vs. Expected behavior
Cookie header is set, but the value it wrong and results in draft mode not being enabled.
Provide environment information
Which area(s) are affected? (Select all that apply)
Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), Vercel (Deployed)
Additional context