Building with functions fails due to compat flag/wrangler version

When I run bun dev locally it fires up my site using wrangler 3.90.0 (as defined in devDependencies and bun.lockb). Everything works nicely. When I then push the build environment tells me it's using wrangler 3.76.0 and gives me the following warning/error:
20:55:21.669 Found _worker.js in output directory. Uploading.
20:55:21.676 ⛅️ wrangler 3.76.0
20:55:21.676 -------------------
20:55:22.645 ▲ [WARNING] The package "node:async_hooks" wasn't found on the file system but is built into node.
20:55:22.646
20:55:22.646 Your Worker may throw errors at runtime unless you enable the "nodejs_compat" compatibility flag. Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details. Imported from:
20:55:22.647 - _worker.js
20:55:22.647
20:55:22.647
20:55:22.647 ✨ Compiled Worker successfully
20:55:22.679 Validating asset output directory
20:55:24.461 Deploying your site to Cloudflare's global network...
20:55:27.182 Uploading... (5/5)
20:55:27.182 ✨ Success! Uploaded 0 files (5 already uploaded) (0.48 sec)
20:55:27.183
20:55:27.559 ✨ Upload complete!
20:55:29.209 Success: Assets published!
20:55:30.406 Error: Failed to publish your Function. Got error: Uncaught Error: No such module "node:async_hooks".
imported from "functionsWorker-0.43069699311041165.js"
20:55:21.669 Found _worker.js in output directory. Uploading.
20:55:21.676 ⛅️ wrangler 3.76.0
20:55:21.676 -------------------
20:55:22.645 ▲ [WARNING] The package "node:async_hooks" wasn't found on the file system but is built into node.
20:55:22.646
20:55:22.646 Your Worker may throw errors at runtime unless you enable the "nodejs_compat" compatibility flag. Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details. Imported from:
20:55:22.647 - _worker.js
20:55:22.647
20:55:22.647
20:55:22.647 ✨ Compiled Worker successfully
20:55:22.679 Validating asset output directory
20:55:24.461 Deploying your site to Cloudflare's global network...
20:55:27.182 Uploading... (5/5)
20:55:27.182 ✨ Success! Uploaded 0 files (5 already uploaded) (0.48 sec)
20:55:27.183
20:55:27.559 ✨ Upload complete!
20:55:29.209 Success: Assets published!
20:55:30.406 Error: Failed to publish your Function. Got error: Uncaught Error: No such module "node:async_hooks".
imported from "functionsWorker-0.43069699311041165.js"
(deployment ID e4f93612-d702-48bb-8116-ab6476b4517a for any Cloudflare folks) My compatibility date is set to today (2024-11-23). I'm guessing at it being the older wrangler version, but I don't know, and I don't know how to update it in the build environment. Any ideas?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server