-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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 JS Preview Mode does not work in Chrome, Safari, Canary, Firefox(v72.02) #18155
Comments
This was referenced Oct 23, 2020
After curl I found out that cookies are being set but in SameSite=None mode. Is that the issue?
|
@shinesingh1994 Make sure your NODE_ENV is set to development |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Next JS Preview Mode does not work in Chrome, Safari, Canary, Firefox(v72.02).
Works in Firefox(v81.01 and above)
Describe the bug
A clear and concise description of what the bug is.
I am working on a Project which uses Contentful CMS and builds multiple static public pages using single slug file. I followed the Next JS Contentful example: https://github.com/vercel/next.js/tree/canary/examples/cms-contentful/
I am able to use the preview mode on Dev(localhost), while making a production build (localhost), the cookies are not being set and the code is not able to enable the preview mode.
Building static pages
pages/posts/[slug.js]
andpages/api/preview.js
is server side rendered for preview modeEnabling preview mode:
Passing context to
getStaticProps
after setting the cookies:To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Preview mode is enabled while on dev build(localhost), but not on prod build(localhost)
Expected behavior
A clear and concise description of what you expected to happen.
Preview Mode should be enabled
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Add any other context about the problem here.
The issue seems to be cookie issue. The cookies are not being set in the browsers provided, and works in Firefox latest version. The cookies are not being set in these browsers causing Preview Mode not to work as intended: https://nextjs.org/docs/advanced-features/preview-mode.
Any solution to the issue would be appreciated, meanwhile I am thinking to use the
pages/api/preview.js
as a server side rendered page to hit an api run time and act as preview page. :)The text was updated successfully, but these errors were encountered: