workers-sdk
workers-sdk copied to clipboard
🐛 BUG: wrangler does not mark `node:async_hooks` as external when `nodejs_als` compatibility flag is used
Which Cloudflare product(s) does this pertain to?
Workers Runtime, Wrangler core
What version(s) of the tool(s) are you using?
3.60.2
What version of Node are you using?
18
What operating system and version are you using?
macOS 14.5
Describe the Bug
Observed behavior
Please describe.
wrangler.toml
#: schema ../node_modules/wrangler/config-schema.json
compatibility_date = "2024-05-24"
main = "src/worker.ts"
compatibility_flags = ["nodejs_als"]
src/worker.ts
import { AsyncLocalStorage } from 'node:async_hooks'
Expected behavior
No warning is generated, since the "nodejs_als" compatibility flag is specified in wrangler.toml.
Actual behavior
▲ [WARNING] The package "node:async_hooks" wasn't found on the file system but is built into node.
from kian on Cloudflare's Discord:
Wrangler has no idea about that flag so it doesn’t know what to do with it. I'd open an issue
I can confirm this is a minor bug and I have a simple fix in the works.
hey @petebacondarwin, did you end up putting that PR anywhere?
https://github.com/cloudflare/workers-sdk/pull/6620