Skip to content
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

Fix draft mode invariant #62121

Merged
merged 13 commits into from
Feb 21, 2024
Merged
6 changes: 5 additions & 1 deletion packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2831,7 +2831,11 @@ export default abstract class Server<ServerOptions extends Options = Options> {
res.setHeader(NEXT_DID_POSTPONE_HEADER, '1')
}

if (isDataReq) {
// we don't go through this block when preview mode is true
// as preview mode is a dynamic request (bypasses cache) and doesn't
// generate both HTML and payloads in the same request so continue to just
// return the generated payload
if (isDataReq && !isPreviewMode) {
Ethan-Arrowood marked this conversation as resolved.
Show resolved Hide resolved
// If this is a dynamic RSC request, then stream the response.
if (isDynamicRSCRequest) {
if (cachedData.pageData) {
Expand Down