Skip to content

Commit

Permalink
fix: rendertoreadablestream is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
奇风 committed Oct 9, 2023
1 parent e7fb0c1 commit 64a9a42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/server/src/ssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export default function createRequestHandler(
};
}

// 新增的给CDN worker用的SSR请求handle
export function createUmiHandler(opts: CreateRequestHandlerOptions) {
return async function (req: Request, params?: CreateRequestHandlerOptions) {
const jsxGeneratorDeferrer = createJSXGenerator({
Expand All @@ -251,8 +252,7 @@ export function createUmiHandler(opts: CreateRequestHandlerOptions) {
throw new Error('no page resource')
}

const stream = await ReactDomServer.renderToNodeStream(jsx.element);
return stream;
return ReactDomServer.renderToNodeStream(jsx.element);
};
}

Expand Down

0 comments on commit 64a9a42

Please sign in to comment.