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

@cloudflare/vite-plugin breaks vite build

We have a custom setup with vite+react. Everything works great in dev, but when we build with the cloudflare plugin enabled, it turns our SPA build into an SSR build or a like (spawns 3-4 parallel build processes, which break some other plugins) Conditionally enabling the cloudflare plugin in development helps, but we're wondering if it removes any build processing as a result? At first glance the deployment seems to work great. mode === "development" && cloudflare()...

Can I use WaitUntil in OpenNext running on Workers?

Currently running nextjs on cloudflare workers via opennext. I have async tasks that take some time that I'd like run in the background. Is there a way to use WaitUntil in opennext?

Cross-account Worker Custom Domain

I've migrated from Pages to Workers + Assets but one thing I cannot get working is cross-account custom domains. I have a worker with 2 envs (so effectively 2 workers) on account A but I want to use a custom domain in one of the envs in a Zone that belongs to account B. Any idea how to get this working? I was able to do this in Pages using custom domains + setting up the CNAME myself in the zone of the other account...

Error 1023

I just randomly encountered a 1023 error on my worker site. After a simple refresh, the page loaded correctly again. However, I couldn’t find the Ray ID in the worker logs, so I have no way of knowing what caused the issue or how often it occurs. Ray ID: 937e3ad9b8d1fff6...
No description

Support for Custom Serialization in Queues (e.g. `superjson`)

Hi everyone, I’d like to propose or ask about native support for custom serialization and deserialization logic when working with Cloudflare Queues. In our current use case, we deal with objects that include Date instances and other complex structures. We’d like to use SuperJSON (or a similar tool) as our default serializer because it handles these cases much more gracefully than JSON.stringify....

Compatibility date releasing

Are versions of @cloudflare/workers-types released in hand with a new compatibility date? For example, @cloudflare/workers-types 4.20250429 was released, does that mean you can now set 2025-04-29 as the compatibility_date in Wrangler config? I know you can put there any date and it automatically falls back to the nearest one but I would like to move only to actually existing ones and don't know how to find out that a new date is available.

Setting up a notification for Usage Based Billing with Cloudflare workers.

Can I do this? My dropdown menu only shows choices for R2 Storage. Is there a way to get an alert if my worker usage goes over the free limits that Cloudflare offers? Thank you.
No description

Clarification on Cloudflare Workers Request Limits

Hello World, I'm testing out Cloudflare Workers and wanted to confirm something. Right now, I'm at 667 requests. I can definitely go up to 100,000 without any charges, correct? I truly appreciate the offer from Cloudflare, but I just want to make sure I won't run into any unexpected invoices. Thanks!...
No description

OpenNext: [unenv] fs.readFileSync is not implemented yet!

Running opennext build and preview yields the ff. error: ```js [unenv] fs.readFileSync is not implemented yet! mnt/c/Users/X/Projects/X/.open-next/server-functions/default/handler.mjs...

Wrangler types using "fetcher" type for RPC binding rather than Service

I have a binding in my wrangler.toml
services = [
{ binding = "TRACE_EXPORTER_SERVICE", service = "observability-service", entrypoint = "TraceExportService" },
]
services = [
{ binding = "TRACE_EXPORTER_SERVICE", service = "observability-service", entrypoint = "TraceExportService" },
]
However when using wrangler types command to generate types I get...

How do I get object metadata within a Worker for an uploaded object?

I'm currently using a Cloudflare Worker to forward uploaded object data to a job scheduler, and I'm unsure how to access the metadata of the uploaded object. ```ts async queue(batch: MessageBatch<Error>, env: Env): Promise<void> { console.log('Received batch:', batch.messages);...

Using --local with workers and D1

Not sure if this is expected, or if I'm doing something wrong here... Having issues with getting a hello-world D1 Database setup using wrangler.jsonc and an explicit migrations_dir. I can't get migrations to be applied, even running explicitly. ...

Bypassing cache from worker fetch

My worker is routed via a https://example.domain.com route, and internally makes sub-requests via fetch to example2.domain.com (origin) Both are proxied behind cloudflare (orange cloud). I need to completely bypass cloudflare CDN, and return headers as they are returned by the origin server. The issue is, no matter what I do, set cf properties on fetch, setting Vary header on origin, trying to send everthing as a POST, Cloudlfare always mangles my header, most importantly stripping the ETAG from the origin....

[SvelteKit & Workers] Building from repo breaks webapp

Initially, I simply build the SvelteKit webapp locally using the cloudflare adapter and used pnpm wrangler deploy to upload the files to be deployed. However, as the project scaled and I implemented proper git version management, I decided to utilize the building straight from the GitHub repo on commit. This comes in very handy when wanting to preview commits to the develop branch. However, whenever the project is build directly by Cloudflare Workers, the page just returns the 500 internal server error, no matter what I do. Considering that building locally and deploying works, what could be causing the Cloudflare build project to break? Thx for any help 🙏 If you need any extra info, just ask I will provide it right away 🫡...

An RPC stub was not disposed properly using meta frameworks

I wanted to open a thread here regarding this issue. I have seen multiple people inlucuding myself that gets this error. I absolutely understand where this error is comming from, finding the solution here is the issue. Small explanation: If you use a meta framework like sveltekit etc and you use RPC on the server (service binding from a normal worker) you will run into this issue. Sadly using or [Symbol.dispose]() dosent seem to work in those enviroments. You will run into framework errors like TypeError: products[Symbol.dispose] is not a function (and if you check if Symbol.dispose exists before trying to dispose it never exists and you still get the error) ...

Ramifications of the use of SSE in CloudFlare Workers

Hey everyone. I've been reading up and dabbling with Server Sent Events and DataStar (https://data-star.dev/). I wanted to discuss if there are any obvious issues with paid Worker plans and long-running SSE responses. The concepts are interesting but I'm wondering if this is an area better suited to a dedicated server proxied by a worker instead of a worker with static assets due to some of the long-running SSE concepts that can be employed. I have SSE and DataStar working locally on a single worker with Static Assets and it seems to be fine but I'm unclear what the impact is of this when it comes to Workers in-general, observability and pricing....

How to use advanced Sentry capabilities?

Hi, I'd like to use sentry's beforeSend hook, but noticed there are 2 very different approaches that could be taken. From Cloudflare: https://developers.cloudflare.com/workers/observability/integrations/sentry/ From Sentry: https://docs.sentry.io/platforms/javascript/guides/cloudflare/ ...

extract images from pdf in a worker via unpdf, and recognize text via AI

Any suggestions here? I tried different stuff, and no luck. Providing a real image works perfectly fine, of course. Failed to process PDF: pdf/17457.pdf AiError: 3010: Invalid or incomplete input for the model: Unsupported image data ```ts...

DDoS Protection for the Workers API, and Does the DDoS Billing Waiver Also Apply to D1/R2?

I’m using ChatGPT for this translation, so please excuse any awkward English. I’m planning to build a game leaderboard API on the paid tier of Cloudflare Workers. Since Workers already come with built-in DDoS protection, would you still recommend:...

File System

Is there a way to access files in your project in workers? I've been trying to host stuff on the same file, Like using deno on the file and then wrangler deploy to post it onto cloudflare, But as it is, Files are a massive issues, I can't host my libraries code, Had to use pastebin, Is there a way to access files? (I am not going to use KV objects, I want something that works with deno aswell), Thanks for your time!
Next