File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/solid-router/src/ssr Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { isbot } from 'isbot'
1414import { transformReadableStreamWithRouter } from '@tanstack/router-core/ssr/server'
1515import { makeSsrSerovalPlugin } from '@tanstack/router-core'
1616import type { JSXElement } from 'solid-js'
17+ import { TransformStream } from 'node:stream/web'
1718import type { ReadableStream as NodeReadableStream } from 'node:stream/web'
1819import type { AnyRouter } from '@tanstack/router-core'
1920
@@ -71,11 +72,14 @@ export const renderRouterToStream = async ({
7172 } as any ,
7273 )
7374
75+ const { readable, writable } = new TransformStream < Uint8Array , Uint8Array > ( )
76+ stream . pipeTo ( writable )
77+
7478 if ( isbot ( request . headers . get ( 'User-Agent' ) ) ) {
7579 await stream
7680 }
7781 const wrappedStream = wrapStream (
78- stream as unknown as ReadableStream < Uint8Array > ,
82+ readable as unknown as ReadableStream < Uint8Array > ,
7983 template ,
8084 )
8185 const responseStream = transformReadableStreamWithRouter (
You can’t perform that action at this time.
0 commit comments