Wrangler Deploy Failing due to: No such module "node:os"

My wrangler deploys suddenly started failing with the following output: ------------- ✘ [ERROR] A request to the Cloudflare API (/accounts/<accountID>/workers/scripts/<workerName>/versions) failed. Uncaught Error: No such module "node:os". imported from "index.js" [code: 10021] To learn more about this error, visit: https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021 -------------- I don't think I'm using node:os and I have the nodejs_compat_v2 falg turned on. Only thing I can think of is maybe I'm over the size limit? But this seems like a weird error for that. Has anyone encountered this before and how can I resolve it?
16 Replies
Walshy
Walshy4w ago
You have something using node:os Likely a dependency Guessing a dependency updated and you are now hitting this
Marc
MarcOP4w ago
What's weird is if I do: wrangler deploy --minify --outdir bundled/ --dry-run And look at the index.js it makes no reference to node:os Is there a good way to no-op this?
Walshy
Walshy4w ago
hmm dry-run should do it
Marc
MarcOP4w ago
Yeah the dry run builds totally fine And it runs locally fine
Walshy
Walshy4w ago
whats your wrangler ver?
Marc
MarcOP4w ago
4.43.0
Walshy
Walshy4w ago
try using latest Only possible thing I can think of is unenv polyfills wrangler adds
Marc
MarcOP4w ago
wrangler deploy

Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md

⛅️ wrangler 4.45.0
───────────────────
Total Upload: 13209.03 KiB / gzip: 2397.72 KiB
Your Worker has access to the following bindings:
Binding Resource
env.RATE_LIMITER (RateLimiter) Durable Object
env.KEY_KV (9f3800cfc55e4314ad3ef1bd61222b61) KV Namespace
env.CF_VERSION_METADATA Worker Version Metadata
env.SENTRY_DSN ("https://249439c69bf8da42b045d91ea1a1c...") Environment Variable
env.ENVIRONMENT ("production") Environment Variable


✘ [ERROR] A request to the Cloudflare API (/accounts/<accoountID>/workers/scripts/<workerName>/versions) failed.

Uncaught Error: No such module "node:os".
imported from "index.js"
[code: 10021]
To learn more about this error, visit:
https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021


If you think this is a bug, please open an issue at:
https://github.com/cloudflare/workers-sdk/issues/new/choose


🪵 Logs were written to "/Users/Marc/Library/Preferences/.wrangler/logs/wrangler-2025-10-25_00-54-22_501.log"
wrangler deploy

Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md

⛅️ wrangler 4.45.0
───────────────────
Total Upload: 13209.03 KiB / gzip: 2397.72 KiB
Your Worker has access to the following bindings:
Binding Resource
env.RATE_LIMITER (RateLimiter) Durable Object
env.KEY_KV (9f3800cfc55e4314ad3ef1bd61222b61) KV Namespace
env.CF_VERSION_METADATA Worker Version Metadata
env.SENTRY_DSN ("https://249439c69bf8da42b045d91ea1a1c...") Environment Variable
env.ENVIRONMENT ("production") Environment Variable


✘ [ERROR] A request to the Cloudflare API (/accounts/<accoountID>/workers/scripts/<workerName>/versions) failed.

Uncaught Error: No such module "node:os".
imported from "index.js"
[code: 10021]
To learn more about this error, visit:
https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021


If you think this is a bug, please open an issue at:
https://github.com/cloudflare/workers-sdk/issues/new/choose


🪵 Logs were written to "/Users/Marc/Library/Preferences/.wrangler/logs/wrangler-2025-10-25_00-54-22_501.log"
No dice
Walshy
Walshy4w ago
hmm cc: @Dario
Marc
MarcOP4w ago
Does my size seem okay?
Walshy
Walshy4w ago
yeah your size is fine if you exceeded size you'd get an error saying that
Marc
MarcOP4w ago
Cool. Just asking because the link in the error log references either being too big or going over the 1 second startup time
Dario
Dario4w ago
yeah I don't think it's related too any limit, the documentation does say: Specific error cases include but are not limited to: @Marc any chance you can share your worker? if it has sensitive info/logic you can also try to strip from it as much stuff as possible and share the result? my gut feeling is that this is related to unenv... 😕 @Victor Berchet or @petebd can have some ideas here
Victor Berchet
I have only checked the first and last message of this thread for now. The best would be to use the nodejs_compat flag (NOT v2) and a computer date after 20240923
petebd
petebd4w ago
Yeah. Any reason why you are using V2 rather than just nodejs_compat
Marc
MarcOP4w ago
Okay so I switched it to V2 and got a different error now. I was only using that because I thought it was more recent (IE v2 being better). Here's the new error:
✘ [ERROR] A request to the Cloudflare API (/accounts/[REDACTED]/workers/scripts/[REDACTED]/versions) failed.

Uncaught TypeError: Cannot read properties of undefined (reading 'parent')
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/node_modules/.bun/@asteasolutions+zod-to-openapi@8.1.0+27912429049419a2/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:126:31)
in get
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/node_modules/.bun/@asteasolutions+zod-to-openapi@8.1.0+27912429049419a2/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:387:37)
in getMetadataFromInternalRegistry
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/node_modules/.bun/@asteasolutions+zod-to-openapi@8.1.0+27912429049419a2/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:390:31)
in getMetadataFromRegistry
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/node_modules/.bun/@asteasolutions+zod-to-openapi@8.1.0+27912429049419a2/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:428:38)
in zod.ZodType.openapi
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/workers/[REDACTED]/src/openapi/schemas.ts:8:6)
[code: 10021]
To learn more about this error, visit:
https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021
✘ [ERROR] A request to the Cloudflare API (/accounts/[REDACTED]/workers/scripts/[REDACTED]/versions) failed.

Uncaught TypeError: Cannot read properties of undefined (reading 'parent')
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/node_modules/.bun/@asteasolutions+zod-to-openapi@8.1.0+27912429049419a2/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:126:31)
in get
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/node_modules/.bun/@asteasolutions+zod-to-openapi@8.1.0+27912429049419a2/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:387:37)
in getMetadataFromInternalRegistry
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/node_modules/.bun/@asteasolutions+zod-to-openapi@8.1.0+27912429049419a2/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:390:31)
in getMetadataFromRegistry
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/node_modules/.bun/@asteasolutions+zod-to-openapi@8.1.0+27912429049419a2/node_modules/@asteasolutions/zod-to-openapi/dist/index.mjs:428:38)
in zod.ZodType.openapi
at null.<anonymous>
(file:///Users/Marc/developer/[REDACTED]/workers/[REDACTED]/src/openapi/schemas.ts:8:6)
[code: 10021]
To learn more about this error, visit:
https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021

Did you find this page helpful?