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

Cannot create binding for class WebSocketServer because it is not currently configured to implement

Hello, I'm trying to setup the durable object in dev branch and I got this error. Is anyone know how to resolve this error? Thanks! [[env.dev.migrations]] tag = "v1" new_classes = ["WebSocketServer"]...

websocket forward proxy server

i am trying to set up a custom WebSocket server. This server will act as an intermediary, forwarding all messages it receives to another WebSocket server ```js async function websocket(url, final) { let resp = await fetch(url, {...

Producer not writing to queue

I have a worker producing messages to a queue. The queue is connected to a consumer. When I go into the CF dashboard and check the queue, it confirms that it is connected to both producer and consumer. I've double checked spelling, its fine. The producer is running as expected. The queue is showing as active. But no messages are reaching the queue. This was working up until yesterday morning. I have not changed the compatibility date which is for May 2024. What could be the culprit?

stop double execution of code when the time limit exceedes

```javascript var worker_default = { async fetch(request, env, ctx) { let counter = 0 while(true){...

Worker doesn't show any logs/Cron job fails when code is good

As strange as the title is, that's exactly what my issue is. My code is a simple discord tool and it's been running fine but suddenly decides to not do anything. I noticed it with when i was trying to implement a new feature and the code was broken and I saw the Exception logs - as expected, but when I fixed it, there would no longer be any logs, Real Time Logs page would just keep spinning on "Websocket connection established. Listening for events..." and that's it. Cron events page would show show the cron job erroring out but no logging is available.
wrangler tail
wrangler tail
doesn't return anything either. If I intentionally break the code again, I get the logs and everything, what's up with this exactly? At the moment, I've minimised the code to simply: ``` addEventListener("scheduled", (event) => {...

Default cache with worker binded

Hi, I am trying to use worker to transform an image into base64 string, and I use R2 to store those images, the structure is as follow: * worker router binding to a domain on CF (abc.xyz) * abc.xyz bind to R2 as public access The problem is that after binding the worker to the DNS, the default Cloudflare cache settings, such as CF-Cache-Status, are no longer applied. ...

script cors bypass geo lock

hello how to make cross x forwarded for ip in workers

Failing to use wrangler secret list

pnpm wrangler secret list
✘ [ERROR] A request to the Cloudflare API (/accounts/ed77d12fd9fc5faef08d17e41fdb2dc5/workers/scripts/project-name/secrets) failed.
workers.api.error.script_not_found [code: 10007]
pnpm wrangler secret list
✘ [ERROR] A request to the Cloudflare API (/accounts/ed77d12fd9fc5faef08d17e41fdb2dc5/workers/scripts/project-name/secrets) failed.
workers.api.error.script_not_found [code: 10007]
...

"internal error" calling .fetch on bound Durable Object

I'm getting this thrown when trying to call DO fetch. I think my worker is configured incorrectly. My worker code is very simple: ```...

Should `unsafe.bindings.ratelimit` have different `namespace_id` for each worker environment?

Lets say I have ```toml [[unsafe.bindings]] name = "RATE_LIMITER" type = "ratelimit"...

Error Code: 10021 on Dashboard

So, I was making a worker on the Dashboard and after putting in a name... I'm getting this error. The date and time on my PC is correct :Thinky:
No description

Worker DNS issue

Hello! We are running into some issues trying to get our worker deployed. ```bash...
No description

Can I use Requests library in a Python Worker

Ok, I don't remember where I read it, but I thought I could use the Requests library to do GET and POST requests. But, I'm getting ModuleNotFoundError: No module named 'requests' error....

How to calculate queue message size before sending it to queue the way CF does it?

Hey folks, Any idea of how Cloudflare calculates queue message size before sending it to queue, a worker of mine throws this: Queue send failed: message length of 165746 bytes exceeds limit of 128000 Because the messages I’m sending to queue can vary in size, I can’t batch the arrays I send to queue by a batchSize because then sometimes it exceeds the limit, what I need is to batch the array based on the size in bytes. ...

Execution Context Canceled When Returning Response Object with Stubs from Service Worker

When calling a method on a Service Worker that returns a Response object containing stubs (remote objects), and then returning that Response object from the caller Worker, the execution context of the called Service Worker is canceled prematurely, even after attempting to dispose the Response object using the using declaration or explicit disposal. ServiceA Worker (wrangler.toml) ``` name = "service-a"...
No description

Workers for platforms authentication

How are users authenticated when using Workers for Platforms? Does each user need their own CloudFlare account or is is possible to support deployment on their behalf?

Workers Routes not adding DNS records, URL returns DNS_PROBE_FINISHED_NXDOMAIN

Hey folks! There seems to be some kind of issue with adding Workers Routes. This has worked fine for me with other sites (including one in the last few weeks), but not with this current domain. I've added a Workers Route for my worker serve-univoter with the route univoter.com , on the zone uinvoter.com. Normally this would (a) add a DNS record for that worker and (b) serve the worker on that domain. This time it's doing neither (see screenshots). I get no DNS records at all, and visiting the site returns DNS_PROBE_FINISHED_NXDOMAIN....
No description

An RPC result was not disposed properly

I have a DO that returns an object and is marked as Disposable. I keep getting this error, and i'm not entirely sure how to go about it, because I thought it automatically disposes?
An RPC result was not disposed properly. One of the RPC calls you made expects you to call dispose() on the return value, but you didn't do so. You cannot rely on the garbage collector for this because it may take arbitrarily long before actually collecting unreachable objects.
An RPC result was not disposed properly. One of the RPC calls you made expects you to call dispose() on the return value, but you didn't do so. You cannot rely on the garbage collector for this because it may take arbitrarily long before actually collecting unreachable objects.
...

API Authentication with Auth0 / other options

Has anyone figured out how to implement authentication with auth0? The original example tutorial was removed and the PR that removed it stated it was due to security security issues although it doesn't state what they are. Another PR has been open since la...