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

DDoS Protection for the Workers API, and Does the DDoS Billing Waiver Also Apply to D1/R2?

I’m using ChatGPT for this translation, so please excuse any awkward English. I’m planning to build a game leaderboard API on the paid tier of Cloudflare Workers. Since Workers already come with built-in DDoS protection, would you still recommend:...

File System

Is there a way to access files in your project in workers? I've been trying to host stuff on the same file, Like using deno on the file and then wrangler deploy to post it onto cloudflare, But as it is, Files are a massive issues, I can't host my libraries code, Had to use pastebin, Is there a way to access files? (I am not going to use KV objects, I want something that works with deno aswell), Thanks for your time!

Protect a Next.JS worker

What are the best practices for implementing rate limiting and generally add protection on a Next.js application deployed to Cloudflare Workers?

Worker URL redirect broken, and deletion of worker doesn't do anything?

I'm using a simple URL redirection script to go to another website, so it is easier to share. When on my main browser (Opera) It redirects to example.com, how ever, on other browsers, it properly redirects. Originally, when putting in the code, I did use https://www.example.com to test, but now, even when deleting that worker and making a new one (same name), it still redirects improperly. Even when deleted, it still redirects, even though it doesn't exist (on the site) anymore. Here is the code I used: ```...

How do you setup development environments for workers that need to interact with local services?

I'm just learning to use Workers and I need to notify a message queue service when a file has been uploaded to my bucket, but during development this services runs locally. Should I use CloudFlare tunnels to connect my worker to my local development server?

Deploy to customers’ CF worker? SSO?

Hi! I’m building a close source solution based on CF Workers and going to sell it to my customers Is there any way to auth their account so my system can automatically call something like wrangler CLI to deploy my worker code (minified) to their CF workers account?...

Bug in Cloudflare dashboard

- Live logs view - Open an entry - See a flash of your logs, and then "no events in selected timeframe" Looks like one of your backend APIs is reporting bad data:...
No description

Is it possible to run Bun.js?

Is it possible to run Bun.js on Cloudflare Workers? Has anyone successfully implemented this?

Error when deploying Worker that has binding to EU R2 bucket.

When creating R2 bucket in the EU, and deploying a worker binding to it, I get the error message: ``` ✘ [ERROR] A request to the Cloudflare API (/accounts/{account_id}/workers/scripts/{worker-id}/versions) failed. ...

Create alert for high error rate on worker

Is it possible to create an email alert when my worker is throwing too many errors based on the logs? Like Google Cloud does.

Worker with --remote not working (Error 1104)

Hi. Yesterday I was setting up a worker to be able to run it locally with remote resources so I can debug the code among other things. It was working fine, however, this morning didn't work. No changes in the code.
yarn wrangler -e dev dev --remote
yarn wrangler -e dev dev --remote
I can provide a Ray ID: 9354db749b4704ad...

The deploy with workers button no longer creates a fork of the original repo.

I usually provide deploy to workers button as an easy way to self deploy my project to friends. And then let them sync their forks to mine for new features. Currently it seems like deploy woth workers creates a new repo and thats not very ideal for my use case

Best-practices and errors for CFworkers+Hono API in monorepo

Hey guys, new to CF. I am currently building a Turborepo and have started researching cloudflare for my dedicated API. I am having some problems with doing a simple Hono app and am reaching out for help as the docs are difficult to reason with. Attached are some context images. I am getting TS errors from my TSConfig with the recent worker-configurations.d.ts typegen file. Not sure how to fix it. Outside of that issue, I am wondering, what are the best practices around CSP and CORS and environment variables? Currently using a Hono middleware with .dev.vars for environment variables, but I am not sure how to access those variables in the hono middleware for setting (for example) the allowed origin headers....
No description

Secret Store In Local Dev Mode?

I am using the new Secrets Store, and using them in a worker using the binding in the toml file, but in dev mode using npx wrangler dev the console shows : Secret "MDB_URI" not found Well Okay the docs say : ``Local development mode...

Worker dependencies failed as soon as Bun detected?

I used the React Router template and deployed it successfully on the web UI, but when I installed the packages locally, made some changes that shouldn't affect anything and upgraded packages, the deployment now fails "while installing dependencies" and detects Bun 1.1.33 "from the environment", even though I initially never specified any Bun-related information in any files but I did have a lock file that I tried removing, and even though I have specified packageManager as bun@1.2.10 and installed devDependencies of the same version of bun and Node 23.11.0 with BUN_VERSION as the same version both in my wrangler script and in the web UI. What's going on and what am I doing wrong? ```log...

wrangler dev error

why can i not fidn a way to dev functions/api/status.js? it works ok on the web on /api/status but i cant find a command to make it work
No description

Suddenly all our ctx.waitUntil workers are failing?

We have been using ctx.waitUntil for 2 years already with Cloudflare workers with the basic code sample below. This has always worked without any issues. Suddenly about an hour ago, all our workers with ctx.waitUntil fail with the following error message: "Can't read from request stream after response has been sent." This has never happend before and we haven't changed our code at all . Wondering if something is down with Workers? ctx.waitUntil(executeWebhookWait(request, env, pathName)); finalResponse = { success: true}; return new Response(JSON.stringify(finalResponse), { status: 200, headers: {...

How to define RPC methods on a separate file

I have an RPC method that is very long and thus don't want to define in the same place as other functions. I though about doing myFunction = myFunction but it complains that The RPC receiver does not implement the method "myFunction". Since myFunction uses this it's defined as: ```ts export async function myFunction( this: AuthWorker,...

Service binding config with the React template + local dev

I've been successfully using service bindings between back-end workers using the basic template and following the guidelines posted here: https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/rpc/ However, when using the React workers template, I can't seem to connect to service workers the same way when testing them locally. Do I need to configure them differently in wrangler.jsonc? (FYI each worker is in its own project/repo) The service binding entry in wrangler.jsonc is as follows:...

Create a New Worker Menu is Missing.

I recall using the "Create new Worker Menu" on the Workers & Pages > Overview page. Can anyone help me understand why I can't find this option anymore? Also, is there a way to create a new worker without using the template? Thank you!...
No description