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

How to upgrade workers to paid plan?

Hi, this link seems to be outdated https://developers.cloudflare.com/workers/platform/pricing/#how-to-switch-the-usage-model because when I view the overview of my workers and settings of indivudal workers I don't see anything regarding usage model. How do I upgrade a worker to paid?

Serve atom feed with cloudflare error (Faild to build)

Hey, I want to serve an atom feed over cloudflare and got recommended to use hono with it. Sadly, I have come across an error when trying to build my project and I cant find a solution to it, sorry. My code: ```typescript import { Hono } from "hono"; import { testFeed } from "./createRssFeed";...

Python Hello World error -4094

As in title. Trying to run the Python workers hello world given in the documentation produces an error code -4094.

Decrementing a count property by 1 with KV and Promise.all

Hi! I'm using workers KV to keep track of # of credits a user has (the count property). i.e. {user1234: {credits: 10}}...

Can I pin my worker to run from specific region?

I have my db in a ap-south-1, the latency would be better if my worker also runs in the same region. I am aware of smart placement, but I couldn't get it to activate for some reason I get Unsupported back-end services although I'm using fetch to Planetscale database....

Do workers support dynamic module imports?

I'm trying to import modules dynamically. Is this supported with workers? // Function to dynamically load database modules based on provider short names async function loadDatabaseModule(shortName: string): Promise<IDatabaseOperations | null> { try {...

Durable Object returning 405s

I am running into some strange behavior - I deployed a new version of a worker with a bound DO 7.5 hours ago. I tested everything locally and in prod, all seemed well. About 1.5 hours ago I noticed that all of my DO requests are returning 405s and the service is very much broken. There were two deployments in the interim with identical code - I tried rolling back to the deployment that was working previously and I'm getting the exact same issue. Could a CF employee help me double-check the health of my DO? Can anyone shed some light on what might be happening here?...

Can I obtain Image width / height from a cloudflare worker?

Is there an API on the workers I can use to obtain the image height and width? As far as I understand I cannot use the web platform to obtain an image height and width on a Cloudflare worker.
Example using the web platform APIs...

Unraveling the 403 Forbidden Mystery: A Cloudflare Worker's

I have developed an API with Cloudflare Worker to analyze and perform SEO audits. For the past few days, I have been receiving 403 Forbidden errors from several client sites that I analyze, and I don't understand how to resolve this issue. Has anyone else experienced this problem?

Getting `TypeError: fetch failed` errors

Another error I'm getting today. Again, I'm developing locally but with --remote. It happens randomly. Any thoughts? ``` ✘ [ERROR] Error on remote worker: TypeError: fetch failed at fetch...

Workers randomly throwing 502 "bad gateway" responses while developing locally with `--remote`

There are so many seemingly random errors thrown by workers while developing locally that the experience can be a drag (I've raised most of these in previous threads here.) Today, I've started getting 502s every now and then. When this happens, I have no choice but to restart the Worker and then the exact same request succeeds. In case it's relevant, I'm developing with the --remote flag for reasons that are outside this topic....

Models giving irrelevant responses

Hello! I recently watched the Youtube video about workers AI on the cloudflare workers channel. I was excited to try out the chat app that the presenter built and eventually ported the application to a Svelte app that handled app state in a cleaner way. Anyways, when I get to testing the models out, they are giving me some pretty irrelevant responses, I've attached a screenshot of the responses to the post. I also have logs of the models and messages sent to the AI binding:...
No description

Small % of 500 errors logged in Cache Analytics but 0 Errors in Workers/Pages metrics

Hi all! We have a very basic Worker proxying a Pages project (to use CF for SaaS) and everything works great. However, yesterday during a (very loose) stress test of a certain workflow, we've seen ~66 requests out of 15k fail with status code 500. 1. Zone > Cache analytics (<zone>/caching?status-code=500) shows the errors https://share.cleanshot.com/B1YVRcRp...

Creating a queue request doesn't work

I've added the queue function to my worker, and send the queue request with the following command env.MY_QUEUE.send(job); I don't get any exceptions but the queue doesn't run.

Pass body request into fetch

Hi, I had some issues with the worker when I tried to use the worker as a proxy for the s3 presigned. It doesn’t go right because the file after upload is corrupted. I tried directly from the client and it worked so I assume my script for the worker having issues.

inconsistent error with Cloudflare worker queues. TypeError: Can't read from request stream because

Hello guys, im currently working on a POC where i try and make a nice starter template. im currently getting this issue when trying to run my queue and read the response "TypeError: Can't read from request stream because client disconnected." i would also like to add that it works sometimes but then when i refresh it throws that error this is my code...

How to implement code-level caching service?

How to use caching on code-level? I need to cache the getAuthUser(userId) function result on code level to avoid querying D1 again and again as the getAuthUser is a middleware used on all the API routes. So, I built a get/set caching function using a fake url, user/1, user/2 etc. But it doesn't seems to be working and I see undefined in cache.match(cacheKey) response always. ```...

Exception with no exceptions

Hello, I have a weird issue. My worker is throwing ends with an exception, but there is no logs or exceptions in the tail. Any ideas what could cause this?...
No description

Cannot get image transformations to work with S3 proxy.

I'm having an issue getting Image Transformations working, and I'm not 100% why. I have a worker that acts as a proxy for my s3 bucket. The function uses the AWS SDK to generate a signed request and then returns that to the client. This is working as expected. I wanted to add image transformations to this. So I updated my return to be: ``` ...

Is there a possibility to create a subdomain for all workers?

As the title says, is there a possibility to have a subdomain like workers.example.com, and then use routes to route different workers? For example workers.example.com/worker-1 etc. Thanks! I wanted to use routes on my domain, but my example.com is already mapped to a Pages project, that means, it is not getting picked up by routes, because CNAME is directing it to pages.dev....