Skip to content

Commit

Permalink
Add compatibility with cloudflare node (#8925)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonsdebt authored and natemoo-re committed Nov 22, 2023
1 parent 411c5f6 commit 7b20803
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/calm-ducks-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/react": patch
---

Uses `node:stream` during server rendering for compatibility with Cloudflare
2 changes: 1 addition & 1 deletion packages/integrations/react/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7b20803

Please sign in to comment.