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

HTTP 522 when using Worker as fallback origin for Cloudflare for SaaS

I'm trying to use a Cloudflare Worker as my fallback origin for Cloudflare for SaaS. I have the worker registered with a custom domain at fallback.mydomain.com. When I hit it directly, I see the response from the Worker. I then have fallback.mydomain.com registered as my fallback origin in SSL/TLS > Custom Hostnames....

Secrets Store Bug on Worker

I added this to my jsonc: ``` "secrets_store_secrets": [ {...

Durable Object (sql backend) transaction.put not saving

i'm trying to understand how to use transactions to perform batch operations, as running standard sql transactions on the storage sql property throws an error saying to use the javascript api, but i cannot find any documentation for the javascript api or how to use it
✘ [ERROR] queriesAddBatch error: Error: To execute a transaction, please use the state.storage.transaction() or state.storage.transactionSync() APIs instead of the SQL BEGIN TRANSACTION or SAVEPOINT statements. The JavaScript API is safer because it will automatically roll back on exceptions, and because it interacts correctly with Durable Objects' automatic atomic write coalescing.
✘ [ERROR] queriesAddBatch error: Error: To execute a transaction, please use the state.storage.transaction() or state.storage.transactionSync() APIs instead of the SQL BEGIN TRANSACTION or SAVEPOINT statements. The JavaScript API is safer because it will automatically roll back on exceptions, and because it interacts correctly with Durable Objects' automatic atomic write coalescing.
...

import { env, nextTick } from "node:process";

Cannot find module 'node:process' or its corresponding type declarations. ``` "compatibility_date": "2025-04-04", "compatibility_flags": ["nodejs_compat"],...

Anyone managed to deploy a Python worker using Pulumi?

I tried this worker = cloudflare.WorkersScript("hello-world-worker",
script_name="hello-world-worker-py",...

Not getting all invocation logs

Hi, I’m building a TRMNL plugin with a Worker. My GET and POST requests executed manually from my computer appears in the Invocation logs but not one specific POST request on a specific route from TRMNL’s servers, even though the request counter on the Metrics page gets properly incremented. Head sampling rate is at 100 %. It’s like some IP gets filtered somehow...

Help: env.RESEND_API_KEY is undefined in my Worker despite being configured as a Secret

I'm encountering a very frustrating issue with my Cloudflare Worker and hoping someone might have some insight. The problem is: My Worker (luisminutri-email-handler) is failing because an environment variable (RESEND_API_KEY), which is configured as a "Secret" in the Worker settings, consistently comes back as undefined at runtime. Key details:...
No description

How to connect to D1 remote with React

Hello everyone, I create a React app by following: https://developers.cloudflare.com/workers/frameworks/framework-guides/react/ However, it starts the dev mode by using command npm run dev instead of wrangler dev ...

Google sees 404s from my SPA (served through not_found_handling)

I have a Worker with a single page app serving on routes not matched by the worker code. ``` "assets": { "not_found_handling": "single-page-application" },...

Best current practice to track stats?

I used to use CF Key/Value, but is Durable Objects better?

Build failing with `Error occurred prerendering page "/_not-found". `

hey, i just converted a nextjs app from next-on-pages to opennext. The build succeeds locally with the opennextjs-cloudflare build command, but when I push via git to the branch, the repo-connected worker keeps failing with the following message. I never got this error on next-on-pages. Any insight or advice here? ``` 23:44:06.784 Collecting page data ... 23:44:19.007 Generating static pages (0/38) ... 23:44:20.432 Generating static pages (9/38) ...

How to run a specific environment while using the vite plugin?

I’ve set my environment variables for "dev" and "production" but i can’t set it to "dev" 😦 I’m using react router, which allows me to forward the --mode arg but not pass an -e to wrangler...

service core:entry: This Worker requires compatibility date "2025-03-17", but the newest date suppor

Hello, I just updated from wrangler 4.0 to latest and now I'm getting this error, why?
No description

Error when calling worker via service binding

Hi! I am calling another worker via a service binding but am getting this error:
TypeError: this.config.adapter?.connect is not a function
TypeError: this.config.adapter?.connect is not a function
...

DNS Settings for Email Routing

I need help how i need to configure email routing for the following scenario: I want to to route the mail noreply@example.com to an email worker, but all other mails like name@example.com to gmail. For both I need to configure different MX records. I guess I need to point the MX records to cloudflare, but how can I achieve then that I can read and write emails for other addresses to gmail? Is there a workaround or best practice?...

How do I use Cloudflare's react-router RequestHandler?

So I've built a javascript react SPA using the Cloudflare vite plugin and it retrieves files from R2 and works well. I have been studying the react-router addressbook tutorial[1] and I am pretty comfortable with it. I created a react-router application per the instructions on the Just Use Vite page[2] and it creates a RequestHandler: `const requestHandler = createRequestHandler( () => import("virtual:react-router/server-build"), import.meta.env.MODE...

Is JSPI enabled in V8 for workerd?

Hi, I believe there is some support for Jspi (workerd/src/workerd/jsg/jsg.h#L2679-2680) but when running my code (which simply asserts "Suspending" in WebAssembly), it fails. Adding "python_workers" as a compatability_flag simply makes it crash on startup from at workerd/api/pyodide/setup-emscripten.c++. I would appreciate any help on this -- thanks.