diff --git a/packages/server-renderer/src/renderToStream.ts b/packages/server-renderer/src/renderToStream.ts index 4952b51c267..cf0c3debb74 100644 --- a/packages/server-renderer/src/renderToStream.ts +++ b/packages/server-renderer/src/renderToStream.ts @@ -47,6 +47,10 @@ function unrollBufferSync(buffer: SSRBuffer, stream: Readable) { } } +class PushSafeReadable extends Readable { + _read() {} +} + export function renderToStream( input: App | VNode, context: SSRContext = {} @@ -62,7 +66,7 @@ export function renderToStream( // provide the ssr context to the tree input.provide(ssrContextKey, context) - const stream = new Readable() + const stream = new PushSafeReadable() Promise.resolve(renderComponentVNode(vnode)) .then(buffer => unrollBuffer(buffer, stream))