-
Notifications
You must be signed in to change notification settings - Fork 27k
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-1120] draftMode().enable()
does not set cookie if followed by redirect()
#49237
Comments
This was happening for me too, was able to fix with this for now.
|
Thank you for the alternative solution @andrew-mcmaster. |
I was pulling my hair until I saw this. |
This was happening because my runtime was forced to edge.
|
It seems that |
I checked my 3rd party settings in chrome as given in the notes and wondered why it did not work in localhost. decided to upload on server and still had the same error. Now, I see this issue, I can finally sleep :) |
draftMode().enable()
does not set cookie if followed by redirect()
- Fixes vercel#49237 fix NEXT-1120 Co-authored-by: Wyatt Johnson <633002+wyattjoh@users.noreply.github.com>
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 Binaries: Node: 16.19.0 npm: 8.19.3 Yarn: 1.22.19 pnpm: N/A Relevant packages: next: 13.4.0 eslint-config-next: 13.4.0 react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://github.com/jornki/next-draft-bug
To Reproduce
Describe the Bug
When using redirect in combination with
draftMode().enable();
, the__prerender_bypass
cookie is not set. However, if you return a Response instead of using a redirect the cookie is set.Expected Behavior
The
__prerender_bypass
cookie should be set.Which browser are you using? (if relevant)
Tested with latest Firefox and Edge
How are you deploying your application? (if relevant)
Tested locally (dev and start)
NEXT-1120
The text was updated successfully, but these errors were encountered: