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

WebSocket Test examples

Are there any examples of test automation using websockets against a worker ? Don’t see any among https://developers.cloudflare.com/workers/testing/vitest-integration/recipes/ wondering how this is done

Local development connects to sparrow.cloudflare.com and only accessible using Cloudflare WARP?

Hi, I'm trying to create a project using Cloudflare Workers. But it seems that wrangler dev is not working. When I set the log-level to debug these appears: (image 1)...
No description

How do I configure an Apex Domain for Cloudflare Workers & Static Assets?

I've worked through the following setup guides to configure an Astro site on Cloudflare Workers & Static Assets: - Framework guide for Astro - Custom Domains for Workers ...

Env Variables in Workers Static Site [Vite + React]

Hey All, I am building a React + Vite app using cloudflare workers. It is a SPA with no workers backend. Is there any documentation around how to get environment variables into the frontend React app? I see everything is focused on how to get them into the workers runtime, but I am looking to access them from the bundled React code, where I normally use import.meta.env with vite

Uncaught Error: Dynamic require of "events" is not supported

Going through the Hyperdrive Mysql guide and hitting this error consistently. I've got nodejs_compat and compat date set according to the guide(although different guides use different compat dates, I've tried both). Still hitting the error. wrangler.staging.toml:...

Static Assets Support in Workers

In cloudflare workers im doing something like the following to get static assets working with hono those work fine ie .css .js etc files are all routed correctly however for assets that are workers ie im using sqlocal and it needs the following headers
c.req.raw.headers.set('Cross-Origin-Embedder-Policy', 'require-corp');
c.req.raw.headers.set('Cross-Origin-Opener-Policy', 'same-origin');
c.req.raw.headers.set('Cross-Origin-Embedder-Policy', 'require-corp');
c.req.raw.headers.set('Cross-Origin-Opener-Policy', 'same-origin');
...

Direct connection to Postgres DB with SSL enabled (for Rust worker)?

I am trying to connect directly (without Hyperdrive) to my Postgres DB (hosted on Supabase) via a Rust worker using tokio-postgres, as follows: ``` let conn_str = env.secret("DB_CONN_STR"); let config = tokio_postgres::Config::from_str(conn_str)?;...

Looking for feedback on a WAF-false-positive workaround with a Worker

Background - We have a web-mail POST endpoint behind CF Enterprise WAF.
- Fields like html_body, image, compose_cc often trigger false-positives.
- We do want WAF Managed Rules on the rest of the form (To/From/Subject/etc). ...

Node.JS Compatibility Error...

so following the video, I was expecting this error, but when I go to add that flag, then things have changed a bit. the flag that is suggested by the error, 'nodejs_compat' is no longer in the list, and instead, there are 2 similar available: with or without populate_process_env. see screenshot. I tried both of them, they don't work. I'm still getting that error. any idea?...
No description

responseStreamDisconnected errors when making 6+ sub requests in worker

We are using ctx.waitUntil() API to make sub requests to send metrics/logs to DataDog, and when there are 6 or more requests, the request/response that is being returned is truncated. When looking at real-time worker logs, the outcome field is set to "outcome": "responseStreamDisconnected", . There are no other errors that are present. The format we are using to send metrics is ctx.waitUntil(async function() { return await fetch(...)});. The individual requests all function correctly, and I can reproduce this error by enabling any one of them, but if they are all enabled together, an error occured. We have the following wrangler.toml config:...

Durable Object console logs on the dashboard

How can I see the durable Object console logs on the dashboard? I can see the worker logs in the corresponding worker, but the console logs from my worker are not visible.

Deployment on Workers build goes fine, but waits until it timeouts

Hi, I have a strange issue that began this morning (Europe time). My Opennext build and deployment goes fine, but the Build box stays "up and running" until the 20 minutes timeout occurs. See the timestamps in the screenshot, it idles for 7 minutes even if the build is done and deployed. Normally some more lines appeared after the "Current version ID": ``` Success: Deploy command completed...
No description

Access wrangler properties in code

Hi, can I access wrangler properties in code?
No description

Requests from Cloudflare Workers to external API result to 520

Hi, When making a request to my API from cloudflare workers it returns 520. URL: https://api.staging.us.modeinspect.com/...

I can't add my domain

@SuperHelpflare @Flare @SuperHelpflare I can't add my domain (biddabari.com) to Cloudflare. I have some issues with this domain name, but I can't find it. I don't have any due. All bills are paid. Please help me. Error-1 : Refer to https://cfl.re/3VUQyyL for assistance. The zone cannot be upgraded at this time. Error-2 : could not run legacy post zone sub request against new zone products: failed to update user subscription: failed to apply object products: You cannot add or modify subscriptions or services until the outstanding balance is paid. You should be able to do so in your Billing page....
No description

Cloudflare node version change

Hi dev, please help me out on changing the node version,
I have tried to set the NODE_VERSION 20.9.0 in the env form, still it is responding...
No description

cacheEverything: true vs Cf-Cache-Status: DYNAMIC

Hi all, I have 2 zones on 1 account. Both have very similar Cache Rules, where effectively Cache eligibility evaluates to "Eligible for cache". Then I have a Cloudflare worker deployed to both zones, which contains piece of code: ``` const response = await fetch(requestUrl, {...

override_existing_dns_record

@Vero @SuperHelpflare We deployed our frontend to workers assets, but we have A record for our domain and when we trying to configure Custom domain it showing error:(
already has externally managed DNS records (A, CNAME, etc). Either delete them, try a different hostname, or use the option 'override_existing_dns_record' to override.
i tried to find any information regarding override_existing_dns_record but didn't find any documentation regarding that https://developers.cloudflare.com/search/?query=override_existing_dns_record...

How to redefine types generated by `wrangler types`

Running wrangler dev generates ```ts declare namespace Cloudflare { interface Env {...