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

Please help me explain

Please help me explain if the domain name vietlot135s.com is registered at cloudlfare or where did they register the domain name and then redirect it to cloudlfare

Workers Preview Builds

Howdy, Is it possible for Workers to have preview branches like Pages? The compatibility matrix says it's doable, and I'm aware of wrangler versions upload - but I'm most interested in previews being automatically made for branches like we can with pages now. It would be really helpful in allowing migration off next-on-pages to opennext. Thanks!...

Jimp and canvas on cloudflare workers

I need to generate a simple image using certain variables for my app's users to print... I was thinking of using Jimp and Canvas to create the image on the fly and return it as a response to the users. I want this to run on my Cloudflare worker since my main API is also there, and I've already gone through a lot of work to be able to make the API work on a worker, this was due to various node compatibility issues, but... I made it work! I can't put my API on an actual server right now because the project's current state still doesn't make it worth the time or money to host a server. Besides that, I've gotten so comfortable with Workers that I can't imagine using ExpressJS or something similar. So, is there a way I can use Jimp or canvas on Cloudflare workers? Because right now they seem to be giving me trouble...

Can we create WAF custom rules in free version?

I want to create a WordPress plugin to manage WAF custom rules for a specific zone ID. Can we use the Cloudflare API endpoint https://api.cloudflare.com/client/v4/zones/{zone_id}/rulesets to create custom rules in the free version of Cloudflare?

How to cache workers with static assets (beta)?

I used to have my app deployed with pages I moved to the worker + assets beta so I can have access to logs. Unfortunately now my cache hit rate is zero. In my backend I do: ...
No description

Deployments broken?

Are Worker deployments busted? I'm getting ✘ [ERROR] A request to the Cloudflare API (/accounts/[snip]/workers/scripts/[snip]/versions) failed. after deployment, and have been since last night. Redeploying known good versions encounters the same error....

Can I do what I want with websockets in a worker?

I havent used websockets in workers before and have some trouble understanding how it works. I just want to confirm if what I want to do is possible or not: a long-running websocket server that sends messages based on receiving other external events. My actual end goal is something like this: a client (a browser) connects to my worker acting as a websocket server, and they are fed messages over that WS periodically. They are triggered by certain external events, which is the part I'm having trouble thinking about. For example, say I have a discord bot (running somewhere else) that wants to trigger an event on this worker websocket, how would I do that? Sending a simple webhook to my worker with the event data sure, but how do I feed that through to that websocket connection? Is that the part durable objects helps with? Thank you...

Abuse protection is rejecting API traffic from our servers

Requests to api.trigger.dev are getting blocked by a “worker” rate limiter rule with 429 responses and the code 1015. These requests are coming from our Digital Ocean cluster and shouldn’t be getting blocked. We have a Cloudflare worker for api.trigger.dev, but the traffic that's getting blocked is just passed through to the original URL. What we’d like to have happen:...

{"error":"Error","message":"Token and remote not found"}

Hey guys, I always get this error in my worker's edit code's Preview pane even with the "Hello World" template. I have tried creating an API Token for "Edit Cloudflare Workers" using the default template and chose All accounts and All zones. Still no success. It used to be ok though. Any help?...
No description

Issues testing a worker

Hey there! When I try to run tests in my worker using cloudflare:test with vitests I have issues on localhost (in enviroment test works perfectly) In the tests I try to connect to my database using a standard PG client but the error I'm having is: "Error: no such module (node_modules/pg/lib/pg-cloudflare") pg-cloudflare is not inside of pg, it's is own folder on node_modules, I tried to manually change the path but got the same error. Does anyone had the same issue?...

Help with calling/declaring env variables

I've made a worker with environment variables (secret) that I have set from the web dashboard, I am using the web editor to write my code but I am not able to reference/call the env variable and constantly get the error Cannot read properties of undefined (reading 'RATE_LIMIT') How should I go about this?...

Hyperdrive database host string too short?

Hey there, I noticed Cloudflare changed Hyperdrive's database host string validation to 63 characters max. Previously I had Hyperdrive instance built with a longer query string and it worked fine, but now if I intend to use AWS RDS, its host string is a little bit longer than this limit. I would not want to make a CNAME record, therefore exposing DB host in domain's DNS. Any ideas how to tackle this? I wonder if it is only front-end validation, maybe Cloudflare Terraform setup would not get validated like that?...

New Rate Limiting Feature Broken?

Figured I'd move the discussion from https://discord.com/channels/595317990191398933/779390076219686943/1318423484715499582 to here. Hey all, We are testing out the beta rate limiting feature for Cloudflare workers and it appears that it is somewhat broken. I understand that this is eventually consistent, but it appears that this consistency is never achieved. ...
No description

Cache not matching

Hey there, I already had quite some projects with Cloudflare workers (and caches). However, i encountered an issue with cache put and match from different endpoints.
- When matching in the same endpoint where the put happens i get a cache hit. Same when putting in the endpoint where match happens. - I tried a static URL/string (a subdomain of my worker domain) and still no match. - I tried to use a custom cache instead of caches.default without luck ...

How do i leverage Cloudflare for a large scale oneshot task

we have a couple hundred thousands of videos on cloudflare stream, and we want to back those up with another storage provider. for moving the videos, we are thinking on using cf workers and queues. i would be thrilled if someone can provide some reading material on the following broad questions: - how do i write a large scale oneshot operation with workers - what is the general pattern for dealing with pipeline errors in the cf ecosystem - how do i implement pausing and resuming of the pipeline...

Custom Domain doesn't seems to works with a Worker with Static Assets deployment

I've published a Worker with Static Assets ( but Static Assets only, so without worker ), and I can see it on my workers.dev website. But I've just bought a new domain and I've attached a Custom Domain to it, I can see the new DNS configuration to the worker, but it's not works. In HTTP or HTTPS, it's like I'm trying to reach an inexistent domain name. I've also tried to add SSL/TLS configuration in Strict mode, without any success....

RPC of a Service Binding / DO: Adding middleware?

I don't see any references in the docs so I assume the answer is no, but I'm wondering if it's possible to add middleware in any way to Durable Object RPC classes or Service Bindings? I could envision a potential userland solution, but I'm curious if there is something that already exists?...

Gut check: For 200k page Jekyll site, Workers => R2, yeah?

I need to move a large legacy Jekyll site off Github Pages. All pages are fully static and the pages will never change again. It's an interim solution while I finish a complete rebuild in SvelteKit. Looking for community input to confirm (or reject!) my current thinking and maybe flesh out any possible gotchas....

How long does it take for paid plans to take effect?

I signed up for the Paid Workers $5 tier in order to get the higher subrequest limit, but my cron jobs continue to fail once they hit the 50 subrequest mark. Can someone tell me when my paid workers will start operating?
Next