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

How to remove email name from default worker's subdomain pattern?

The current pattern seems like this https://{workerName}.{emailName}.workers.dev I did find a solution in cloudflare community forum, but I can not find such setting in overview page. https://community.cloudflare.com/t/change-account-name-in-worker-url/539680...

How to test two binding workers in dev environment?

I have 2 workers, one of which needs to call the fetch result of the other worker. I understand that we can modify the services binding in wrangler.toml to enable two workers to call each other. But if I don’t want to deploy and just want to test the modification results locally (wrangler dev), is there a more convenient method? For Example: worker A: services = [...

Workers not receiving some requests?

I think this is going to hard to troubleshoot -- but we're seeing CloudFlare workers not receiving a number of requests. We have a script that triggers analytics tracking to both our Nginx server as well as our CloudFlare worker. When comparing the two with wrangler tail, we have significantly less requests to our CloudFlare worker than our Nginx server, even though they're being sent at the same time, from the same script (only the domain is different a.example.com vs b.example.com) ...

managing DNS by CLI? create subdomain with IP via CLI?

hi dear Cloudflare Team, i got a question, do you guys now how to setup DNS in CLI, without to visiting the Homepage? just like gh repo create in github chatgpt shows me this command, but i couldn't found any documentation ...

Can I assign a worker binding during runtime?

Provided I have the account_id and the bucketName as well as an api key with the ability to do this, can I dynamically assign a binding to a worker on runtime?...

Can I safely downgrade to free plan?

We're streamlining our domain setup and going from .com + 8 country TLDs to everything being hosted on .com. In that context I would like to downgrade all the country TLDs to the free plan from the $25 Pro that they currently are on. The only thing that we will need to keep on the country TLDs is DNS and a Worker Route to a worker that handles URL redirects....

how to setup rpc/entrypoints with workers for API access?

hi. so i have an api that is structured as below, and i was wondering how i would represent it within rpc or entrypoints. do i create a base entrypoint and make the rest RPC targets that can be used with a getter (option 1, doesn't seem too difficult), or can i create it with option 2 using classes on the base api class?
``` GET /reports GET /reports/:id POST /reports...

Fetch requests in a Worker that is invoked from Service Binding always return 522

Curl requests to the target api are working fine. I tried moving the fetching code from that Worker to an API route in Next-on-Pages. When I do that, it works perfectly. Not sure what else can I try. My situation seems close to this issue: https://github.com/cloudflare/workers-sdk/issues/2589...

Python workers cannot deploy correctly when using FastAPI

I have recently written a worker in Python, but I have encountered trouble in the deployment: I used FastAPI in my project following the tutorial, and it worked fine in my local environment, but I encountered a deadlock when I wanted to upload it. When I deployed the project following the example project, wrangler told me that requirements.txt is not currently supported. The original text I got was: "You cannot yet deploy Python Workers that depend on packages defined in requirements.txt. Support for Python packages is coming soon. [code: 10021]" When I remove requirements.txt, it says: ModuleNotFoundError: No module named 'fastapi'. What should I do to properly publish the project? See this issue for more technical details...

cron not running locally on the trigger specified

I'm using hono here but when i go to http://localhost:8787/__scheduled?cron=***** i see the response log ```ts ...

Is there any way I could setup bindings on a worker for r2_buckets from different accounts?

In my worker.toml, instead of having something like ```r2_buckets = [ { binding = "STORAGE_1", bucket_name = "storage", preview_bucket_name = "Storage (Private)" },...

Specify a cloudflare worker to only accept request from other cloudflare worker.

I was wondering if there's a way to inspect the request and see if comes from another worker or not (otherwise reject). Or if there's a WAF rule i could set up (though this means every internal Workers would need to be setup externally through WAF)....

Worker isn't triggering on all requests

I have set trigger to domain.com/* however, the worker isn't running on domain.com/file.css just /...

Regression in wrangler 3.46.0: Accessing a Durable Object in another locally running Worker Project

We noticed a regression in accessing a Durable Object in another Worker Project when runnig locally after upgrading to 3.46.0. After this upgrade all calls to the Durable Object are failing with opaque errors. All responses result in a 500 without useful response bodies or headers. We used the following approach to enable a locally running Worker to call another locally running Worker. With this approch we were able to start the two workers locally using wrangler dev and have them communicate with each other. ``` ##############################...

Using WebSockets with PRC in Cloudflare Worker

PRC can communicate with workers and Durable Objects via serializable objects, but Response, including WebScoket, is not considered Serializable, so miniflare does not work. The same thing happens with v8 isolated. ```shell...

Workers AI: getting internal server error

When doing the following call const res = await ai.run('@cf/mistral/mistral-7b-instruct-v0.1', { messages, max_tokens: 1000 }); return c.json({ res }) I'm getting InferenceUpstreamError, httpCode: 504. Any ideas, if i run with the default tokens size (not specifying max_tokens) it seems to work. Btw, running this locally....

How to use WASM with a worker?

The Use from JavaScript section of this page suggests to place an await at the top level of a js file: https://developers.cloudflare.com/workers/runtime-apis/webassembly/javascript/#use-from-javascript However, when I try to do this with my project, I get an error like this: ``` ERROR: Top-level await is currently not supported with the "iife" output format...

Triggering Worker Functions from external Kafka Topic

Hi, I have a external Postgres DB that pushes events via Debezium to a Kafka topic. I would like to react to certain events by triggering a CF Worker. Is there any way I can trigger worker functions in response to Kafka messages or somehow connect a topic to Cloudflare Queues? Thanks in advance!...

RPC Error handling and retries

The new RPC stuff is really great. One question I have is does the RPC calls handle retries? In my current RPC library I retry on these errors which are not uncommon: ```ts const retryOn = new RegExp([ 'Network connection lost',...

Using fetch with wss:// Upgrade: websocket fails

Following the worker + websocket documentation how to connect to a external websocket server but cannot get it to work. I just get Fetch API cannot load: wss://.... Below is the POC ...