Skip to content

Bug: progressiveChunkSize forcing streaming SSR breaks html file integrity and onAllReady behavior #35271

@SoonIter

Description

@SoonIter

React version: 19.2.0

Steps To Reproduce

// App.tsx
<div className="rp-doc rspress-doc">
  <Suspense>
    <MyComp />
  </Suspense>
</div>
function renderToHtml(app: ReactNode): Promise<string> {
  return new Promise((resolve, reject) => {
    const passThrough = new PassThrough();
    const { pipe } = renderToPipeableStream(app, {
      onError(error) {
        reject(error);
      },
      onAllReady() {
        pipe(passThrough);
        text(passThrough).then(resolve, reject);
      },
    });
  });
}

related APIs:

renderToPipeableStream prerenderToNodeStream etc

react 19.1.1

<main class="rp-doc-layout__doc-container">
  <div class="rp-doc rspress-doc">
     <h1>title</h1>
   </div>
</main>

.rspress-doc > h1 works fine

react 19.2.0

If the article content is very long, it exceeds the chunkSize set by React.

<main class="rp-doc-layout__doc-container">
  <div class="rp-doc rspress-doc"><!--$?--><template id="B:0"></template><!--/$--></div>
</main>

<script>requestAnimationFrame(function () { $RT = performance.now() });</script>
<div hidden id="S:0">
  <h1>title</h1>
</div>

.rspress-doc > h1 🤕

Related links

The current behavior

onAllReady returns a HTML with streaming rendering

The expected behavior

onAllReady behavior as the same as React 19.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions