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

Local Integration Testing

I need to test my stripe webhook and also test against my d1 database after the webhook is ran which is not possible via vitest. I cannot use vitest-pool-workers because the endpoint will not be available to my local machine, only the internal testing environment. This is not possible stripe listen --forward-to localhost:PORT/endpoint The first option listed here looks like my best choice:...

How to prevent Worker from running on certain colocations?

We're using Anthropic's API. Some of our users from South Korea are being routed to the Hong Kong Cloudflare colocation, and Anthropic's API doesn't accept requests from China (& Hong Kong). We want to block Workers from routing to Hong Kong (& instead route to, say, the one in Seoul, KR).

upload data to local r2 buckets

hi, i am developing locally with wrangler, and i was wondering if there are any tools to / common paths to interact with locally simulated buckets. i'd like to update them to hold some data, but its not clear how i see on my terminal Your worker has access to the following bindings: - R2 Buckets: - MY_BUCKET: my-bucket-dev [simulated locally]...

Parsing .EML using workers

i have tried using a variety of mail parsers with workers but since workers does not have full nodejs compatibility, i am unable to use buffer or stream etc which is used by popular libs such as mailparser. is there a workaround or a compatible lib which could do it on workers?

Deploying from dashboard disables logs (and resets folder settings)

Hello! I've created and edited a worker entirely in the dashboard. Every time I change a line of code and press Deploy, the logs are disabled. My wrangler.toml, which I also have to re-enable in the folder settings after every deployment: ```name = "myworkername" main = "worker.js" compatibility_date = "2023-08-23" ...

Getting blocked when trying to deploy worker

I came across an interesting issue just now. I tried to deploy my worker with some new code so i clicked on the Deploy button. Then the message "API Request Failed: PUT /api/v4/accounts/ACCOUNT ID/workers/services/forwardreleases/environments/production?include_subdomain_availability=true (403)" came up. So i checked in the Network tab of my Browser to see what's going on and it seems like i am getting blocked by cloudflare? At least i see it when i visualize the html it returns i get this what's shown in the screenshot. Ray ID is:
929a2fba1c461c05
929a2fba1c461c05
I tried:...
No description

Questdb Nodejs Client not working

I get this error when trying to run the questdb client in miniflare. I have posted a minimum reproducible error - https://github.com/apolo-damasco/cf-workers-questdb ```⎔ Starting local server... ✘ [ERROR] Error sending data TypeError [ERR_INVALID_ARG_TYPE]t" argument must be of type number. Received type string ('utf8') ...

Network error with outbound fetch() requests (some domains working, others not)

When using fetch() requests on Cloudflare, we now experience "error code: 525" for the past 4 days on certain worker custom domains, not the workers.dev domain. https://keyauth.win/psdb - error code: 525 https://keyauth-worker.agentreachout.workers.dev/psdb - success (no SSL error) https://prod.keyauth.com/psdb - success (no SSL error)...

Periodically re-importing D1 database and Maintenance mode

I have a read-only REST API serving (semi) static data. Each month the data changes and we basically get a full name database; there is no diff or whatsoever available. So my idea was to drop the existing D1 tables, and run the import script. And in the meantime return a maintenance response....

Error Cannot read properties of undefined (reading 'get')

Hello, I'm new to Cloudflare and Durable Objects. I have written my first test app that attempts to synchronize a TinyBase store into a durable object. I'm receiving two errors for each request: 1) Cannot read properties of undefined (reading 'get')...

My worker serves sitemap.xml but Google can't read it

I don't have a static site on the domain so if cloudflare chooses to not proxy and run the worker then it will fail, but is there a policy about when cloudflare will step back and try to make the client use the static site? I can't be sure that's the problem, so maybe it's something else. Is there a way to see what Google sees?...

Does Cloudflare Workers will handle custom HTTP/S headers?

Hi, I am looking forward to use CW as middleware to create custom headers for a website to secure it in a better way. Website itself has been created using Webflow and there is not a way to add custom HTTP/S headers by the admin panel nor domain registar does not provide any tools to do that. I've learned that CW can do that, so I would like to know how to preprare before I start. Is there an specific knowledge (i know HTML/CSS/JS/TS and tools around like Git quite well). I haven't done that before and I am looking for professional tips to do it properly....

I just created a hello world worker from a template and it times out

I have no idea why. I had other workers running and they stopped working. I assumed it was something about the code, but then I created a completly new, fresh worker with a hello world template provided by cloudflare and that ALSO times out. I've contacted support, but maybe someone with a similar issue might be faster. It probably is some very stupid misconfiguration somehwere but i've tried to fix it with no luck 😢...

Environments best practices

With workers I can have a "default" environment (placing things in the root of the wrangler.jsonc, and n environments such as development. What's better: having the "default" be the production one with the development one being specified as a separate env (requiring me to add -e development when using that), or having the "default" one be the development, with the prod being its own env?

Attaching to multiple localhost workers via vscode? What's the port I need to give?

Hi, the advice in the following link doesn't seem to work if I try to attach to multiple running workers on localhost and attaching to them: https://developers.cloudflare.com/workers/observability/dev-tools/breakpoints/ The link mentions port 9229, it makes sense that I'd need to give a different one for each debugger but where would I see which port gets used and how do I configure that? Thank you...

Error 1015 on D1 database

I recently checked my error logs and find out that it is getting Error for D1 database requests (but not web fetch requests) I am calling from cron and I am aware of the 50 subrequest/call (free tier). I got error 1015 (I believe from D1 read) and D1_ERROR Error exexuting batch insert. I checked the Rows Written in D1 database page and it is only showing a few hundreds. Rows Read is 2.5k....

Replacements for pages _headers and _redirects

Hi, I've just migrated from pages to workers for my remix/react router apps. I used the _headers and _redirects for forcing cache headers on all files under a directory, and removing trailing slashes. e.g. ``` /favicon.ico? Cache-Control: public, max-age=3600, s-maxage=3600...

Error 1101

Hi I am new on Cloudflare. And I got this Error 1101. I plan to remove my domain from cloudflare, its was setup by Inter from lovable.dev Wondering what is the best way to remove the domain properly. So I can use my domain again...

Domain Issue

earlier i changed hosting from vercel to cloudflare, how long would it take for my Domain to be available again?

Does Cloudflare email worker verifies SPF and DKIM?

Hey, I'm wondering if email worker verifies SPF/DKIM and checks DMARC policy before it runs email function. I've searched through documentation and I haven't found information about this. I know that in raw email body are full headers (including spf and dkim checks), do we have to check them ourselves?...
Next