Bug: [React 19 | Streaming SSR] Script tags injected via ChunkExtractor not appearing in final HTML when using renderToPipeableStream
Description
I am using React 19, Express, and Streaming SSR (renderToPipeableStream) along with @loadable/server ChunkExtractor to extract and inject script/style tags for client-side hydration.
The loadable-stats.json is generated correctly, and ChunkExtractor.getScriptTags() returns the expected
However, when I inject these
This issue happens even though: Scripts are extracted correctly onAllReady() is called res.write(scripts) is executed SSR output is streamed successfully
React version: 19.2.0
Steps To Reproduce
https://github.com/sandeep3690Butte/node-r19-ssr
1.git clone
Repository Structure
client/ → all client React code
server/ → Express SSR server
webpack.* → server/client configs for dev + prod
The current behavior
The onAllReady() callback is triggered correctly res.write() executes with no error But no script tags appear in the final HTML Client JS never loads, causing hydration to never run No errors in server logs or browser console
The expected behavior
The
We're currently closing the pipe destination by default when you call pipe(stream). That's why calling stream.write() in onAllReady does nothing since the Stream is already closed.
pipe from renderToPipeableStream would need to accept options to prevent closing the destination e.g. https://nodejs.org/api/stream.html#readablepipedestination-options or https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo#options