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

[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!

Protect a Next.JS worker

What are the best practices for implementing rate limiting and generally add protection on a Next.js application deployed to Cloudflare Workers?

Worker URL redirect broken, and deletion of worker doesn't do anything?

I'm using a simple URL redirection script to go to another website, so it is easier to share. When on my main browser (Opera) It redirects to example.com, how ever, on other browsers, it properly redirects. Originally, when putting in the code, I did use https://www.example.com to test, but now, even when deleting that worker and making a new one (same name), it still redirects improperly. Even when deleted, it still redirects, even though it doesn't exist (on the site) anymore. Here is the code I used: ```...

How do you setup development environments for workers that need to interact with local services?

I'm just learning to use Workers and I need to notify a message queue service when a file has been uploaded to my bucket, but during development this services runs locally. Should I use CloudFlare tunnels to connect my worker to my local development server?

Deploy to customers’ CF worker? SSO?

Hi! I’m building a close source solution based on CF Workers and going to sell it to my customers Is there any way to auth their account so my system can automatically call something like wrangler CLI to deploy my worker code (minified) to their CF workers account?...

Bug in Cloudflare dashboard

- Live logs view - Open an entry - See a flash of your logs, and then "no events in selected timeframe" Looks like one of your backend APIs is reporting bad data:...
No description

Is it possible to run Bun.js?

Is it possible to run Bun.js on Cloudflare Workers? Has anyone successfully implemented this?

Error when deploying Worker that has binding to EU R2 bucket.

When creating R2 bucket in the EU, and deploying a worker binding to it, I get the error message: ``` ✘ [ERROR] A request to the Cloudflare API (/accounts/{account_id}/workers/scripts/{worker-id}/versions) failed. ...

Create alert for high error rate on worker

Is it possible to create an email alert when my worker is throwing too many errors based on the logs? Like Google Cloud does.

Worker with --remote not working (Error 1104)

Hi. Yesterday I was setting up a worker to be able to run it locally with remote resources so I can debug the code among other things. It was working fine, however, this morning didn't work. No changes in the code.
yarn wrangler -e dev dev --remote
yarn wrangler -e dev dev --remote
I can provide a Ray ID: 9354db749b4704ad...

The deploy with workers button no longer creates a fork of the original repo.

I usually provide deploy to workers button as an easy way to self deploy my project to friends. And then let them sync their forks to mine for new features. Currently it seems like deploy woth workers creates a new repo and thats not very ideal for my use case

Best-practices and errors for CFworkers+Hono API in monorepo

Hey guys, new to CF. I am currently building a Turborepo and have started researching cloudflare for my dedicated API. I am having some problems with doing a simple Hono app and am reaching out for help as the docs are difficult to reason with. Attached are some context images. I am getting TS errors from my TSConfig with the recent worker-configurations.d.ts typegen file. Not sure how to fix it. Outside of that issue, I am wondering, what are the best practices around CSP and CORS and environment variables? Currently using a Hono middleware with .dev.vars for environment variables, but I am not sure how to access those variables in the hono middleware for setting (for example) the allowed origin headers....
No description

Secret Store In Local Dev Mode?

I am using the new Secrets Store, and using them in a worker using the binding in the toml file, but in dev mode using npx wrangler dev the console shows : Secret "MDB_URI" not found Well Okay the docs say : ``Local development mode...

Worker dependencies failed as soon as Bun detected?

I used the React Router template and deployed it successfully on the web UI, but when I installed the packages locally, made some changes that shouldn't affect anything and upgraded packages, the deployment now fails "while installing dependencies" and detects Bun 1.1.33 "from the environment", even though I initially never specified any Bun-related information in any files but I did have a lock file that I tried removing, and even though I have specified packageManager as [email protected] and installed devDependencies of the same version of bun and Node 23.11.0 with BUN_VERSION as the same version both in my wrangler script and in the web UI. What's going on and what am I doing wrong? ```log...