Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

JavaScript worker accessing secrets store for array

I was using simple environment variables for a variable that was split with ā€œ\nā€. So I could have it all stored in github via toml I converted to using the secret store. I teceived an error that ...

Still got worker exceeded CPU 10ms time limit in Paid plan

Aloha, I've just upgraded my plan to Paid plan in a few hours. However, I still got error messages of worker exceeded CPU time limit. Anyone knows how long it would take for the new CPU time limit in the paid plan to begin effective?

[ERROR] Unable to determine module type for application/source-map mime type

Hi, I'm just trying to get a RPC Service binding working between 2 of our workers, basically added a new class WorkerEntrypoint to Worker A and now get
[ERROR] Unable to determine module type for application/source-map mime type
[ERROR] Unable to determine module type for application/source-map mime type
...

From wrangler: 4.16.0 onwards, @cloudflare/puppeteer .connect API does not work on a worker

Error occurs on the line -
this.browser = await puppeteer.connect({ browserWSEndpoint: wsEndpoint });
this.browser = await puppeteer.connect({ browserWSEndpoint: wsEndpoint });
✘ [ERROR] Error: ws does not work in the browser. Browser clients must use the native WebSocket object...

Worker Duplicated

I ran these two commands: wrangler deploy --name="kno2fy-dev-exp" wrangler versions upload --name="kno2fy-dev-exp" ...
No description

Non-Production Build URLs

I've been using pages to host Hugo sites, but am looking into workers for a new site. In my Pages site, I was using a bash script to build differently for "main" versus "staging", and Pages handled automatically mapping the <branch-name>.pages-name.pages.dev URL for preview builds on branches other than main. If i'm reading the docs correctly, Workers is supposed to also automate preview URLs, but i'm seeing non-main branches trigger changes to the <worker>.<user-name>.workers.dev URL same as a check-in to main. What am I missing? Sidenote: I've also tried following this: https://developers.cloudflare.com/workers/wrangler/environments/#staging-environment-with-workersdev and added npx wrangler deploy --env staging as my preview deploy command....

How do I set the version/tags/message on deploy?

I'm trying to use the github release version as either the tags or message when I upload/deploy. I've been experimenting by running it manually with made up values. No matter what I do, the message/tag doesn't show up. I've tried:...
No description

Issue with Notification Setup for Worker Standard Requests

Hello, I'm trying to set up an email notification for when the total number of Worker Standard requests exceeds a specific threshold. However, I'm not receiving any notifications to my email. I've checked the Workers and Pages overview page and can see the number of standard requests that have been made. I then set my notification threshold slightly above that number, but I’m still not receiving any email alerts. Could you help me identify what might be going wrong?...

Production worker keeps trying to use old code from previous build

I have a worker that's been deployed for over a month. 5 days ago I changed the code we were using there (renamed a trigger.dev task), but for some reason it keeps trying to trigger the task with a name that it's not even being mentioned in the code anymore. Any ideas about how can I fix this?...

Production worker - response code 520

getting this error on one of my workers... not sure why this would happen
No description

wrangler dev --remote: Browser Redirects to Production URL

Hello everyone, I'm encountering an issue with wrangler dev --remote in Cloudflare Workers. In my understanding, this command should generate a temporary preview deployment with a URL in the format <VERSION_PREFIX>-<WORKER_NAME>.<SUBDOMAIN>.workers.dev. However, when I run npx wrangler dev --remote, my files upload successfully, but the browser redirects to the production URL <WORKER_NAME>.<SUBDOMAIN>.workers.dev instead of the expected preview URL. Additionally, I checked the Deploy version, but I couldn’t find the uploaded preview version. Here’s what I’ve observed: Command output: ✨ Success! Uploaded 9 files (74 already uploaded) (1.64 sec) [wrangler:inf] GET / 307 Temporary Redirect (1705ms)...

Any way to change the workers.dev subdomain?

I've been stuck with this one, with my old account name, is there any way to change this?
No description

Can the DurableObject `ctx` able be safely used as WorkerEntrypoint `ctx` object?

Lets say I have a Worker with service entrypoints like so: ```ts // WorkerEntrypoint class definition export class MyEntrypointService extends WorkerEntrypoint<CloudflareEnv> { constructor(ctx: ExecutionContext, env: CloudflareEnv) {...

Adding a type for a secret to worker-configuration.d.ts

What's the recommended way of adding the fact that a secret exists to the automatically generated worker-configuration.d.ts? Is it possible to hint at it in the wrangler file?

"Sorry you have been blocked" via local worker

A colleague is having a peculiar issue getting a simpler worker to run with wrangler dev from her mac. When trying the simplest of scripts to fetch data from an example API (https://api.restful-api.dev/objects), it throws an error "Sorry you have been blocked" in Postman and browser. The API endpoint can be access directly in Postman and browser just fine. In order to debug, we tried different things: 1. switched her connection from broadband to cellular hotspot (different provider, different IP/gateway etc) - no effect., 2. installed and turned on CF Warp - no effect.,...
No description

Prisma + D1 fails when external API returns 429 error in Cloudflare Workers

Issue When an external API (CoinGecko) returns a 429 error, subsequent Prisma queries to D1 fail with: `` PrismaClientUnknownRequestError: Invalid prisma.userDeposit.create()` invocation: Error occurred during query execution: ConnectorError(ConnectorError { ...

`ReferenceError: XMLHttpRequest is not defined` crashes Next.js API

I've been experiencing inconsistent and sometimes hard-to-reproduce crashes in a fullstack Next.js application hosted on Cloudflare Pages (with @cloudflare/next-on-pages). Only 3 out of 30+ endpoints cause this: where the function runs fully and succeeds, and then every API call afterward will fail with 500 errors ReferenceError: XMLHttpRequest is not defined. The API remains in a "crashed" state for a few minutes until (what I assume) the Worker restarts itself. The app's page routes load perfectly fine, but no API routes work at all during these few minutes. The error message is indicative of a Node.js API support issue: a library I'm using seemingly references XMLHttpRequest under the hood which isn't supported in the Edge runtime. I've suspected it was supabase-js (despite using the custom fetch implementation) . I've since refactored the suspect endpoints to only use fetch and no other third-party libraries, yet the same issue happens. It's also important to note that even though I have a few endpoints that consistently crash the API, there are many other endpoints (containing both read and write operations) that also use supabase-js and even axios that are called many times throughout the app with no crashing whatsoever. It only happenes with a few specific endpoints. The endpoints that begin failing with ReferenceError: XMLHttpRequest is not defined were previously working before the suspect endpoints were called....

Need help getting FFmpeg working on Workers (close, have got it working when running locally)

With some help from @Rui Figueira, I can get ffmpeg-wasm working on Workers, but cannot upload the bundle to Cloudflare as it is over 10mb. I have tried to download the wasm binary from a bucket and load it dynamically, but I cannot seem to get it to work with the Workers runtime and the Wrangler build tool. I saw something about Vite maybe being able to use URLs for imports, but I have no experience with this. Has anyone been able to do this? Or know of any solutions. Here is the code: ```...

How can I make requests to my RPC WorkerEntrypoint worker.

Feels like a dumb q, but I can't figure out if there's a reasonable way to do this without adding another worker to make the actual calls. It's a lot less convenient than when I have an HTTP worker that I can quickly use my browser after a wrangler dev. Am I missing something? Can I use the default export fetch to proxy over to the WorkerEntrypoint nstead?

White-list IP's.? now

Where's the tab to white-list some IP's.? now