Error on remote worker: APIError: A request to the Cloudflare API failed

For Workes & Pages, what is the name of the domain?

web-data-cf-stage.lytcode.workers.dev

What is the error number?

10021

What is the error message?

Uncaught Error: No such module “node:buffer” imported from “index.js” [code: 10021]

What is the issue or error you’re encountering

Can’t run $ wrangler dev --remote -e stage --test-scheduled on a browser rendering worker. I get this - Error on remote worker: APIError: A request to the Cloudflare API (/accounts/redactedaccountnumber/workers/scripts/web-data-cf-stage/edge-preview) failed.

What steps have you taken to resolve the issue?

Upgraded wrangler from 3.72 to 3.78.8 but that didn’t resolve the issue.

What are the steps to reproduce the issue?

The error started to appear a couple of hours ago as I was actively developing and testing locally. Prior to that, I was able to run $ wrangler dev --remote -e stage --test-scheduled without any errors occurring on the remote worker. I don’t know what’s causing the issue, thus I can’t describe the steps to reproduce it.

Screenshot of the error

We’re seeing the same error. I’ve opened a case with enterprise support to take a look.

The nodejs_compat_v2 change described here has suspicious timing. Node.js compatibility | Cloudflare Workers docs

Whew :sweat_smile: glad I’m not the only one! Good catch on the compatability_flag as potential cause. Thanks for pointing that out @jboulter ! Wasn’t aware that a new flag was introduced.

It seems the note implementation went wrong and it’s applying the v2 flag even when the compatibility date is before, mine is “2024-08-21”

1 Like

There’s a status page update for this now. Cloudflare Status - Workers Preview Issues

Hey,

This is now fixed. Sorry for the issue and thank you everyone for the reports!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.