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

[solved] How to upload vars along with a wrangler deployment

I know we can use .dev.vars for local development. But how do I set the env vars for production and development deployment? I can't add them to wrangler.toml as it gets commited to git.

How to wrangler deploy a dev worker?

I would like to deploy two workers, one for production (which would have a custom domain) and a dev worker with no custom domain.

Failure in deploying ratelimit - must have `namespace_id` even though it is defined in wrangler.toml

Here is my wrangler.toml ```toml [[unsafe.bindings]] name = "RATE_LIMITER" type = "ratelimit"...

PostGIS

Hello all! Do you know how activate postgis extension on postgres?

Workers platform broken for requests with cache mode no-store

Hi, an update a few hours ago completely broke my app with the following exception: Error sending request: Unsupported cache mode: no-store. It uses an external library (@azure/cosmos) which apparently specifies this cache options when creating fetch requests. It is known that caching is not supported by Workers, but please make sure the option does not break the requests any more.

When running wrangler dev are HTTP request headers like CF-Connecting-IP supposed to be added?

I'm testing an implementation of a rate limiter built using DOs and CF-Connecting-IP is not present along with other request headers. Is this supposed to be added in the test environment?

Request from Quora bot for ogImage is getting blocked by cloudflare

I noticed some time ago that our website's ogImage is not being fetched by quora. And it turns out that, the request from quora bot is getting blocked by cloudflare as unrecognized bots. It's probably a security measure. But, i didn't find any way to allow Quora to fulfill the request. I tried adding custom rules in Websites -> [domain] -> Security -> WAF. But, it don't seems to resolve the issue. Anyone else facing this issue? Any solution how to solve this?...

Conflict between Cloudflare Workers checks & Cloudflare docs

I'm using Python for my Worker, and This Cloudflare page described that I can use aiohttp package, but when i include that package along with fastapi in requirements.txt, I have the error: " found in requirements.txt. Note that requirements.txt should contain package names only, not version specifiers. I tried many ways to remove the error: - Remove the requirements.txt, after that my Worker return ModuleNotFoundError error - Add packages back requirements.txt (or even empty the file), after that Wrangler still said " found in requirements.txt. Note that requirements.txt should contain package names only, not version specifiers....
No description

Calling a private service behind a cloudflared tunnel

I currently have service running in a private VPC on AWS that I want to talk to from CloudFlare Workers. So I set up a cloudflared tunnel to it. I got everything working by setting up a public hostname and protecting it with a "Self-Hosted" Application using aa service auth token. However I'm a bit uncomfortable with having a public DNS record (even if it's technically protected by the Application policies). e.g. what if someone accidentally deletes the Application? Is it possible to get rid of the public hostname altogether and call the *.cfargotunnel.com address directly from Workers?...

Are there analytics for which endpoints on my worker are being requested, and request methods?

I want to know API endpoint on my worker is being requested the most, as well as the type of request method being used - is this possible or are the workers analytics limited to the number of requests hitting the worker domain?

Using `R2 + image transformation API` vs the `Images` service

Are these effectively the same but with a lower storage cost for R2 storage? What are the advantages to using the Images API for storage vs the former?

D1_ERROR: Wrong number of parameter bindings for SQL query.

Hello, can someone tell me what I'm doing wrong that I get this error? If you need more Infos please ask. ``` export default {...

Helsinki workers down?

Any way to force requests to alternate paths when one worker region is down?

Post request, getting 405 error not allowed

I have a CF pages site that sends a post request to a worker with a api with Hono framework, when i run both worker and page localy it workes no problem, but when its remote on the cloud, and i send the post request form the page to the worker it gets a 405 error on the page. i have no idea why.

How to rapidly validate if a JS package will work on Workers runtime?

Like the old 'Works on Workers' catalogue which disappeared. Node.js / javascript / typescript packages. I know this page exists: https://developers.cloudflare.com/workers/runtime-apis/nodejs/ but without a deep dive into other packages you cannot identify whether a package will 'just work'. As an example of two popular packages, stripe works but @sendgrid/mail doesn't Is it a matter of trial and error? Or Google [package] cloudflare workers each time and hope someone has written a blog post? That will become exhausting quickly....

Newbie Assistance with Worker Code

Hello - I'm fairly new to Cloudflare and I'm making my first attempt at using a Worker. The goal is to have the Worker add a SAS token, from an Azure storage account, anytime a specific URL is processed in CF. For example, if the URL is sub.mydomain.com, add the SAS TOKEN (stored as a variable) so that the URL becomes sub.mydomain.com?<SASTOKEN>. I found a blog post where someone explained how to do this: https://www.eliostruyf.com/cloudflare-serve-private-azure-storage-blobs/ Using the code provided:...

Wrangler versions deploy - deploy latest version?

I'm using wrangler 3.55.0 in the context of a CI/CD pipeline in Github Actions. When a new git tag gets created, I'm trying to perform the following: (1) Create new Worker version via wrangler versions upload for the git tag...

Wrangler dev runtime error on macos

I use macos, I setup a project in local but I cant run wrangler dev src/index.ts MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above. at Miniflare2.#assembleAndUpdateConfig (/Users/0x/Projects/project-alpha/node_modules/miniflare/dist/src/index.js:8989:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Mutex.runWith (/Users/0x/Projects/project-alpha/node_modules/miniflare/dist/src/index.js:3500:16) {...

service binding for ethereum gateway

I am paying for a cloudflare ethereum gateway and I am wondering if it's possible to bind a worker to it via regular binding or service binding to take advantage of the things listed here: https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/

Dynamic CSP Content Security Policy with workers

Hi, I'm injecting the CSP using a Cloudflare worker, the CSP allows loading images from google.com. The issue is when I open the page in Ecuador the CSP blocks an image because the image URL is google.com.ec/ref/... (it is loading from the google's ecuadorian subdomain). This is because Google Analitycs uses the regional domain to load the tracking pixel. How can I update the worker to get the google domain's country of the request e.g. (if Ecuador => google.com.ec) So I can add it to the CSP.