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
{{ message }}
Repository navigation
resumeAndPrerender behavior doesn't seem to match documentation #8755
It's possible this is a bug in the implementation, but I can't find clear evidence of what the intention was, and no tests seem to exercise this path. Given the current behavior, I don't understand what correct usage of this function would look like.
I reproduced this with react-dom 19.3.1. After an aborted prerender, the prelude returned by resumeAndPrerender contains only the postponed content: the hidden <div id="S:0"> segments plus the $RC scripts. It has no <!DOCTYPE>, <html> or shell. It's byte-for-byte identical to what resume() returns for the same postponed state. So new Response(prelude) as in the docs example serves a broken page. You need to send the original prerender prelude first and append this output after it.
One more thing on the same page: the example passes bootstrapScripts, but resumeAndPrerender ignores it (no /main.js in the output), the same as the resume caveat says.
If this is the intended behavior, I'm happy to send a docs PR that:
updates the intro and Returns section to say prelude is the continuation, not a full document
changes the example to append it after the stored prerender prelude
removes bootstrapScripts from the example and adds the same caveat resume has
Or is the full-document behavior the intended one and this is an implementation bug?
Clarifies in the resumeAndPrerender reference documentation that the returned prelude Web Stream is not necessarily a standalone, complete HTML document if rendering was postponed or aborted.
Problem
The documentation for resumeAndPrerender previously stated:
prelude: a Web Stream of HTML. You can use this stream to send a response in chunks, or you can read the entire stream into a string.
And showed a code snippet returning new Response(prelude) directly.
This caused confusion for developers who expected the prelude stream to always yield a fully formed HTML document. In reality, with partial pre-rendering (PPR), if components postpone or abort during prerendering, the prelude only contains the static shell and resolved segments. Developers who return prelude directly as the response body without combining it with a resumed stream end up serving an incomplete document.
Solution
Updated the return description for prelude in resumeAndPrerender.md to explicitly state that the stream contains the rendered shell and resolved segments, and is not necessarily a complete HTML document if postponed or aborted.
Added guidance that delivering a complete response requires combining the static prelude with the resumed stream or ensuring root tags without unhandled postponed boundaries.
Changes
src/content/reference/react-dom/static/resumeAndPrerender.md: Updated the prelude return value description.
Activity
mhdnihadot commentedon Nov 16, 2026
I reproduced this with react-dom 19.3.1. After an aborted
prerender, thepreludereturned byresumeAndPrerendercontains only the postponed content: the hidden<div id="S:0">segments plus the$RCscripts. It has no<!DOCTYPE>,<html>or shell. It's byte-for-byte identical to whatresume()returns for the same postponed state. Sonew Response(prelude)as in the docs example serves a broken page. You need to send the original prerender prelude first and append this output after it.One more thing on the same page: the example passes
bootstrapScripts, butresumeAndPrerenderignores it (no/main.jsin the output), the same as theresumecaveat says.If this is the intended behavior, I'm happy to send a docs PR that:
preludeis the continuation, not a full documentbootstrapScriptsfrom the example and adds the same caveatresumehasOr is the full-document behavior the intended one and this is an implementation bug?
pawannyadav05 commentedon Nov 21, 2026
Fixes #8755
Summary
Clarifies in the
resumeAndPrerenderreference documentation that the returnedpreludeWeb Stream is not necessarily a standalone, complete HTML document if rendering was postponed or aborted.Problem
The documentation for
resumeAndPrerenderpreviously stated:And showed a code snippet returning
new Response(prelude)directly.This caused confusion for developers who expected the
preludestream to always yield a fully formed HTML document. In reality, with partial pre-rendering (PPR), if components postpone or abort during prerendering, thepreludeonly contains the static shell and resolved segments. Developers who returnpreludedirectly as the response body without combining it with a resumed stream end up serving an incomplete document.Solution
preludeinresumeAndPrerender.mdto explicitly state that the stream contains the rendered shell and resolved segments, and is not necessarily a complete HTML document if postponed or aborted.Changes
src/content/reference/react-dom/static/resumeAndPrerender.md: Updated thepreludereturn value description.PR opened in #8768.