You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wasn't able to reproduce the issue in the sandbox, but it shows a simplified version of what I'm doing.
Open a preview in a new window, since the nested preview window doesn't add the preview cookie somewhere it can read.
Click "Enter Preview Mode" link to enter preview mode.
Click "End Preview"
Current vs. Expected behavior
When the "End Preview" link is clicked it should turn off preview mode and redirect back to the page that was previewed (based on documentation here). Instead it throws an error in my local environment because the data object is undefined.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Home
Available memory (MB): 32370
Available CPU cores: 16
Binaries:
Node: 20.10.0
npm: 8.18.0
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 15.1.6 // There is a newer version (15.1.7) available, upgrade recommended! (I also tested this with 15.2.0-canary.64, but had the same results)
eslint-config-next: 14.2.3
react: 19.0.0
react-dom: 19.0.0
typescript: 5.4.5
Next.js Config:
output: standalone
⚠ There is a newer version (15.1.7) available, upgrade recommended!
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue
Which area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
next dev (local), Vercel (Deployed)
Additional context
When I delete middleware.ts it works as expected, so it's definitely something about how the middleware functions that is causing it to fail. I did notice that the data was there at there when the getStaticProps retrieves the data after preview mode is exited. This data is lost somehow by the time the page is rendered though. I'm not making any changes in _app.tsx to how the props are passed along. I am just passing the pageProps to the Component element.
The text was updated successfully, but these errors were encountered:
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/muddy-sunset-nqqdr9
To Reproduce
I wasn't able to reproduce the issue in the sandbox, but it shows a simplified version of what I'm doing.
Current vs. Expected behavior
When the "End Preview" link is clicked it should turn off preview mode and redirect back to the page that was previewed (based on documentation here). Instead it throws an error in my local environment because the data object is undefined.
Provide environment information
Which area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
next dev (local), Vercel (Deployed)
Additional context
When I delete middleware.ts it works as expected, so it's definitely something about how the middleware functions that is causing it to fail. I did notice that the data was there at there when the getStaticProps retrieves the data after preview mode is exited. This data is lost somehow by the time the page is rendered though. I'm not making any changes in _app.tsx to how the props are passed along. I am just passing the pageProps to the Component element.
The text was updated successfully, but these errors were encountered: