From d0b53e6bea0f149fbf7f3a9693e55c1ec4a4b436 Mon Sep 17 00:00:00 2001 From: jdecroock Date: Thu, 19 Feb 2026 18:36:33 +0100 Subject: [PATCH 1/4] Ensure we return a full document --- src/lib/chunked.js | 21 ++++++++++++++- test/compat/render-chunked.test.jsx | 41 +++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/src/lib/chunked.js b/src/lib/chunked.js index cd1686d1..e9a0f631 100644 --- a/src/lib/chunked.js +++ b/src/lib/chunked.js @@ -23,19 +23,38 @@ export async function renderToChunks(vnode, { context, onWrite, abortSignal }) { // Synchronously render the shell // @ts-ignore - using third internal RendererState argument const shell = renderToString(vnode, context, renderer); - onWrite(shell); // Wait for any suspended sub-trees if there are any const len = renderer.suspended.length; if (len > 0) { + // When rendering a full HTML document, the shell ends with . + // Inserting the deferred