Not sure if you can use node_compat in Pages
Not sure if you can use node_compat in Pages
node:buffer unfortunately.npx wrangler pages dev --compatibility-flags="nodejs_compat" -- npm run devnode_compat (the original one) works with Pages.node_compat vs nodejs_compat not the little js hehenpm install it and then search for buffer, fs, etc in node_modules but that might not catch everything.
node_compat vs nodejs_compatjust npm i -S and import, on Google we edit the package.json and it just work.
Your worker created multiple branches of a single stream (for instance, by calling response.clone() or request.clone()) but did not read the body of both branches. This is wasteful, as it forces the system to buffer the entire stream of data in memory, rather than streaming it through. This may cause your worker to be unexpectedly terminated for going over the memory limit. If you only meant to copy the request or response headers and metadata (e.g. in order to be able to modify them), use the appropriate constructors instead (for instance, new Response(response.body, response), new Request(request), etc).
wrangler pages dev public, but when deployed to CF its throwing 404.html


wrangler pages dev only watch the /functions directory for file changes? trying to reason about how to structure a project that has types in /common and queries and mutations in the /database folder. Currently needing to restart the dev server when I change those shared files./functions and build out folder structure in there, and then when the UI needs shared stuff it can be a bit more configurable to watch code in the functions folderout not .vercel/output/static (which is for vercel build)nodejs_compatnodejs_compatjsnpm installfs> Using @sveltejs/adapter-cloudflare
21:38:26.511 ✘ [ERROR] Could not resolve "crypto"
21:38:26.512
21:38:26.512 .svelte-kit/output/server/chunks/hooks.server.js:4:26:
21:38:26.513 4 │ import * as crypto$1 from "crypto";
21:38:26.513 ╵ ~~~~~~~~
21:38:26.513
21:38:26.513 The package "crypto" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
21:38:26.514
21:38:26.516 ✘ [ERROR] Could not resolve "node:buffer"
21:38:26.517
21:38:26.517 .svelte-kit/output/server/chunks/hooks.server.js:6:23:
21:38:26.517 6 │ import { Buffer } from "node:buffer";
21:38:26.517 ╵ ~~~~~~~~~~~~~
21:38:26.517
21:38:26.517 The package "node:buffer" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
21:38:26.517
...
21:38:26.532 error during build:
21:38:26.532 Error: Build failed with 4 errors:
21:38:26.532 .svelte-kit/output/server/chunks/hooks.server.js:4:26: ERROR: Could not resolve "crypto"
21:38:26.532 .svelte-kit/output/server/chunks/hooks.server.js:6:23: ERROR: Could not resolve "node:buffer"
21:38:26.532 .svelte-kit/output/server/chunks/hooks.server.js:7:26: ERROR: Could not resolve "node:crypto"
21:38:26.532 .svelte-kit/output/server/chunks/hooks.server.js:9:22: ERROR: Could not resolve "node:util"justjustYour worker created multiple branches of a single stream (for instance, by calling or ) but did not read the body of both branches. This is wasteful, as it forces the system to buffer the entire stream of data in memory, rather than streaming it through. This may cause your worker to be unexpectedly terminated for going over the memory limit. If you only meant to copy the request or response headers and metadata (e.g. in order to be able to modify them), use the appropriate constructors instead (for instance, , , etc).
wrangler pages dev public/common/database/functionsout.vercel/output/static