diff --git a/packages/houdini-react/src/plugin/codegen/render.ts b/packages/houdini-react/src/plugin/codegen/render.ts index 3387b8fc47..da91bb856e 100644 --- a/packages/houdini-react/src/plugin/codegen/render.ts +++ b/packages/houdini-react/src/plugin/codegen/render.ts @@ -70,49 +70,65 @@ export const on_render = return new Response('not found', { status: 404 }) } - // this is what hangs - const { - readable, - injectToStream, - pipe: pipeTo, - } = await renderToStream( - React.createElement(App, { - initialURL: url, - cache: cache, - session: session, - assetPrefix: assetPrefix, - manifest: manifest, - - ...router_cache() - }), - { - webStream: production, - userAgent: 'Vite', - } - ) - - // add the initial scripts to the page - injectToStream(\` - - - \${documentPremable ?? ''} - - - - \`) - - if (pipeTo && pipe) { - pipeTo(pipe) - return true - } else { - return new Response(readable) - } + const stream = React.renderToReadableStream(React.createElement(App, { + initialURL: url, + cache: cache, + session: session, + assetPrefix: assetPrefix, + manifest: manifest, + + ...router_cache() + })) + + + // // this is what hangs + // const { + // readable, + // injectToStream, + // pipe: pipeTo, + // } = await renderToStream( + // React.createElement(App, { + // initialURL: url, + // cache: cache, + // session: session, + // assetPrefix: assetPrefix, + // manifest: manifest, + + // ...router_cache() + // }), + // { + // webStream: production, + // userAgent: 'Vite', + // } + // ) + + // // add the initial scripts to the page + // injectToStream(\` + // + + // \${documentPremable ?? ''} + + // + // + // \`) + + // if (pipeTo && pipe) { + // pipeTo(pipe) + // return true + // } else { + // return new Response(readable) + // } + + return new Response(stream, { + headers: { 'content-type': 'text/html' }, + }); + } export function createServerAdapter(options) { diff --git a/packages/houdini-react/src/runtime/routing/Router.tsx b/packages/houdini-react/src/runtime/routing/Router.tsx index 900a84707a..9db465411b 100644 --- a/packages/houdini-react/src/runtime/routing/Router.tsx +++ b/packages/houdini-react/src/runtime/routing/Router.tsx @@ -41,7 +41,6 @@ export function Router({ assetPrefix: string injectToStream?: undefined | ((chunk: string) => void) }) { - return
hello!
// the current route is just a string in state. const [currentURL, setCurrentURL] = React.useState(() => { return initialURL || window.location.pathname