-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101
Binaries:
Node: 16.14.2
npm: 8.6.0
Yarn: 1.22.18
pnpm: N/A
Relevant packages:
next: 12.2.5
eslint-config-next: 12.0.4
react: 17.0.2
react-dom: 17.0.2
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
Next.js introduced a new feature of setting preview mode on custom paths. This is great, as it sets the preview cookie for a subset of pages only.
However, this doesn't work with soft navigation to those particular set of pages because Next.js reads the JSON from /_next
path for the soft nav part.
Therefore, if my preview mode is set on, say, /learn/vitest
path, it would only work on other pages if we do a full page reload while visiting other pages. Otherwise, on soft nav with Link
component, it would request the props JSON data from /_next
path which would not have the preview mode cookies and hence would not load it in preview mode.
Expected Behavior
Described above
Link to reproduction
N/A
To Reproduce
Described above