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
You have something using node:os
Likely a dependency
Guessing a dependency updated and you are now hitting this
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?
hmm dry-run should do it
Yeah the dry run builds totally fine
And it runs locally fine
whats your wrangler ver?
4.43.0
try using latest
Only possible thing I can think of is unenv polyfills wrangler adds
No dice
hmm cc: @Dario
Does my size seem okay?
yeah your size is fine
if you exceeded size you'd get an error saying that
Cool. Just asking because the link in the error log references either being too big or going over the 1 second startup time
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 hereI 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
Yeah. Any reason why you are using V2 rather than just nodejs_compat
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: