From ac5633b8f615fe90ea419e00c5c771d00783a6e2 Mon Sep 17 00:00:00 2001 From: brandonsdebt <124833708+brandonsdebt@users.noreply.github.com> Date: Thu, 16 Nov 2023 14:47:46 +0100 Subject: [PATCH] Add compatibility with cloudflare node (#8925) --- .changeset/calm-ducks-divide.md | 5 +++++ packages/integrations/react/server.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/calm-ducks-divide.md diff --git a/.changeset/calm-ducks-divide.md b/.changeset/calm-ducks-divide.md new file mode 100644 index 000000000000..1cacaaf5a79c --- /dev/null +++ b/.changeset/calm-ducks-divide.md @@ -0,0 +1,5 @@ +--- +"@astrojs/react": patch +--- + +Uses `node:stream` during server rendering for compatibility with Cloudflare diff --git a/packages/integrations/react/server.js b/packages/integrations/react/server.js index 26596289eb8c..05ee66c6a817 100644 --- a/packages/integrations/react/server.js +++ b/packages/integrations/react/server.js @@ -53,7 +53,7 @@ async function check(Component, props, children) { } async function getNodeWritable() { - let nodeStreamBuiltinModuleName = 'stream'; + let nodeStreamBuiltinModuleName = 'node:stream'; let { Writable } = await import(/* @vite-ignore */ nodeStreamBuiltinModuleName); return Writable; }