spirobel
Explore posts from serversCDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
yes. I run a bun run build in a github action. I think I could define createRequire during the build process. https://www.npmjs.com/package/create-require but unsure if it is worth the effort. Is there a plan to catch up with deno / bun when it comes to node compatibility?
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
with deno it works. they support the node:module thing. So I can use the target node to bundle my backend and deploy it to deno. or self host. It would be nice to also deploy it to cloudflare workers. But that would mean I would have to switch to target browser and that means I would have to rewrite many things. Would it be possible to use the wrangler bundler on top of the already bundled package that was bundled for the node target?
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
node:module is not supported in cf workers, right?
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
my example looked something like: import { entryPoint } from "../dist/bundledwithbunthing.js";
import process from "node:process";
import { Buffer } from "node:buffer";
just the import statement at the top while still lead to the error message
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
I think I found the issue: I use bun to build a package with target: "node" and it adds this to the bundle:import{createRequire as Ff} from"node:module"; just importing this package is enough to trip up wrangler
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
lets take a look if it makes a difference
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
ohhh and wrangler as a dependency instead of dev dependency
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
that looks like this
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
name = "experiment-worker"
main = "entrypoints/cf.js"
send_metrics = false
compatibility_flags = [ "nodejs_compat" ]
compatibility_date = "2024-01-29"
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
and i have a wrangler.toml
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
i didnt use the -j
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
and wrangler dev -j
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
interesting. no errors. the only difference I see is that this uses a wrangler.json
22 replies
CDCloudflare Developers
•Created by spirobel on 2/18/2024 in #workers-help
nodejs compat mode problem: Uncaught Error: No such module "node:module"
I added compatibility_flags = [ "nodejs_compat" ]
and the dev server stopped working
22 replies
CDCloudflare Developers
•Created by spirobel on 2/3/2024 in #general-help
What is the incentive to add a cloudflare deploy button?
thanks for the quick answer 🙂 👍
3 replies