From 07deb9bd3525971618b7bad472e2e4b55c9e45ee Mon Sep 17 00:00:00 2001 From: Alec Aivazis Date: Sat, 14 Oct 2023 12:26:34 -0700 Subject: [PATCH] Fix webstream detection in development --- packages/houdini-react/src/runtime/server/renderToStream.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/houdini-react/src/runtime/server/renderToStream.ts b/packages/houdini-react/src/runtime/server/renderToStream.ts index 17750ee36..d1d71d36f 100644 --- a/packages/houdini-react/src/runtime/server/renderToStream.ts +++ b/packages/houdini-react/src/runtime/server/renderToStream.ts @@ -7,6 +7,7 @@ import { import { createPipeWrapper, Pipe } from './renderToStream/createPipeWrapper' import { createReadableWrapper } from './renderToStream/createReadableWrapper' import { resolveSeoStrategy, SeoStrategy } from './renderToStream/resolveSeoStrategy' +import { nodeStreamModuleIsAvailable } from './renderToStream/loadNodeStreamModule' import { createDebugger } from './utils' export { renderToStream } @@ -54,7 +55,9 @@ async function renderToStream(element: React.ReactNode, options: Options = {}): const disable = globalConfig.disable || (options.disable ?? resolveSeoStrategy(options).disableStream) - const webStream = true + + const webStream = process.env.NODE_ENV === 'proudction' || (options.webStream ?? !(await nodeStreamModuleIsAvailable())) + debug(`disable === ${disable} && webStream === ${webStream}`) let result: Result