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?
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?