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

Workers transiently dropping REQUEST BODY sending empty body to ORIGIN Server.

We are using CF workers to chnange the hostname and direct to different origion servers based on some URL paths and query parameters. However we have seen less 1% 524 errors. COreeposnding CF RAY ids were not present in origin server. In order to understand the pattern and started to log both request and response contents. However ever since we did, we started getting calls from customers they are are saying invalidation errors(422), that is due to request content being empty. I am suspecting...

env. return undefined in tests

I'm experiencing an issue with environment variables in Cloudflare Workers tests. When running tests using the Vitest configuration, all environment variables accessed through the env object are returning undefined (happens only on cloudfare deployment, locally its as expected) ``` import { env, createExecutionContext } from 'cloudflare:test'; ...

How to reduces rows_read when create table virtual FTS5 in d1 database when use order

when i use order in query from FTS5 table rows_read is has use b-tree for order by how to use index for order by and ignore b-tree for order by...

TypeError: Illegal invocation: function called with incorrect this reference

I got this error when calling some method from generated api client. when class looks like this: ```ts class API { constructor(...

Is it possible to run a REST API with a worker?

I've been trying to build a fairly basic API on a worker using the Hono framework.
But I've been hitting wall after wall, mostly with the fact that workers (wrangler) do not work with standard node env variables. I've read the documentation on worker Environment Variables at least 10 time.. but for whatever reason the context of my app design just wont play nice with this way of passing envars Here's My entry point ...

browser rendering - rest api (server status code is missing on new api)

it returns success true even if server status code is non 200 (for both 4XX and 5XX) any plan to implement a proper error handling hints for rest api users too? need more keys than success and result in here 😬...
No description

D1 adding more latency than expected

Im using sveltekit and i created 2 test routes. they essentially do the same but one does a select 1; in d1. When warm the the difference in response time is 50ms which just seems super high considering the query takes less than 1ms. I chose the cloest location to me when i created d1 I use workers with assets. here the code for both api endpoints i used to just test it out...

APO works incorrectly when routing worker is active

Hi all, I hope you can help me to fix the following issue: it looks like APO fails to work correctly when the routing worker is enabled A bit of background: in order to comply with local regulations in Ukraine we implemented a worker which redirects/re-writes the URL for users in Ukraine. This solution worked well along with APO and ARGO until recently we noticed an increased page loading time, and failure to Verify APO works (using this instruction https://developers.cloudflare.com/automatic-platform-optimization/get-started/verify-apo-works/) In our case:...
No description

Crop images in a worker

Hello, i need to crop a image into 3 parts on a worker. Is there a library which doesnt rely on document or some other API not supported by the workers runtime? Thanks yall!...

Unable to access build time secrets

I have defined some build time variables and secrets. However, in my build script, I am only able to access vriables via process.env.VARIABLE_NAME but not secrets. How to access the secrets?

View Static Assets in the Cloudflare Dashboard? Looking

I am wondering if it is possible to view a list of uploaded static assets, or at least usage/limits? Can't see it anywhere in the console or the docs.

Can't access my worker (https://mockerview.divikshrivastava.workers.), can someone help!

I am getting this error and can't access my worker Error 1101 Ray ID: 91816b6b4d8b2516 • 2025-02-26 16:47:54 UTC Worker threw exception...

update request url with workers static assets

seems like this should be simple, but I can't find any examples. Say I'm using workers static assets, and I have enabled run_worker_first. It seems that env.ASSETS.fetch wants the incoming request passed through - but what if I want to change which file gets fetched? ``` // (example using hono) app.use('/*', async (c, next) => {...

Moved repo to a new GitHub org and now Workers Builds doesn't detect changes anymore

I recently moved my worker from a GitHub org to another, and now if I merge a PR or even simply push a commit it won't create a new deployment. I tried disconnecting and reconnecting the repository, without success. This is pretty important and I would prefer not to delete the project and re-create it if possible. Especially since the UI allows to disconnect and re-connect repos....

workers-mcp: returning other types

Hi there! Has anyone else used the workers-mcp package? It works great, but I can't seem to return any data to the client except text. This might be a misunderstanding of MCP, but I'm curious if anyone else has thoughts. For example: ``` /** * Fetches the Message Data Model (MDM) for a given canonical ID....

Github Build not working (worker-rs)

Getting the error of while the automatic build (github) is running:
... Running custom build: cargo install -q worker-build && worker-build --release
/bin/sh: 1: cargo: not found ...
... Running custom build: cargo install -q worker-build && worker-build --release
/bin/sh: 1: cargo: not found ...
...

Cache Rules in front of worker

Hello - I have an app deployed to a worker, and I'm setting cache headers on my responses. I'm not able to get cloudflare to cache any of my responses, it seems to always bypass and run the worker. I have a cache rule on to make everything eligible for caching, and trace shows me the rule hits, but I never see the cf-cache-status header - rsc.wesbos.com is an example page. Is it not possible to use a worker as an origin and cache it's outputs with a header?...

100K websocket user broadcast

I have an application with about 100K concurrent users needing second-by-second updates of a global state via websockets. I can't find a clear solution on Cloudflare. I do see that Durable Objects might be suitable for long-running websocket connections, but I imagine that'd only be suitable for 1,000 or so users, and Is there any automatically distributed system that allows users to connect via websockets for broadcasted events?...

DKIM - old txt rather than CNAME

Hey, Got an issue here at the moment with our DKIM, which seems to be refering to an old Google Workspace DKIM that was deleted from our CloudFlare DNS record. However when I do a NSlookup it appears to be using the old public key rather than microsoft Cname key?...

Variables not available in pages build?

The "Variables and Secrets" UI suggests we can edit "text, secret, or build variables." However, the only options in the UI are "text" and "secret." I figured they would all just get shoved into the build... but my build has been failing on missing variables. Am I missing something here? How do we set build variables on CloudFlare pages?...
No description
Next