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

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....

DurableObjectStub is missing all methods

Hey, I'm having a little issue. I'm trying my hand at Durable Objects for the first time and I've got some trouble getting them to work. I have this code in my index.ts:...

live stream via workers

How can I make a live stream with a direct link through workers?

Strange issue with `console.log()` omitting members of objects

I'm using Itty Router with CF Workers. For some reason, when working locally and I run console.log(req) (in middleware, obviously) the vast majority of the members of that object are not shown. For example, if I run: ``` console.log(req)...

Postgresql Connection (Node) erroring: No such module "cloudflare:sockets".

I've been trying to test out a CF worker with a basic DB connection and query and tried everything to debug it without any luck. I have: Node - v21.6.1 In my wrangler.toml:...

How to stream R2 file inside FormData in fetch request body?

I was wondering if it’s possible to stream an R2 object to an external API using FormData instead of reading the whole blob into memory. The file size can be more than 2GB. ```ts export default { async fetch(request: Request, env: Env) {...

Why use tail workers over producer worker can be used to send all the logs itself?

I want to collect error logs in my app and I came across tail worker. And I couldn't understand the logic behind its existence. Why would I use tail workers when I can just send all the errors and logs at the end of the request. I can use try catch block to capture all the errors and also save the tail workers invoke request costs which is same as workers? Do it provide any added benefits that I couldn't get?

Is it possible to migrate an exisitng Parse Server project to Cloudflare workers?

Hi! I am new to Cloudflare workers and pages. I am wondering is it possible to use Cloudflare workers to replace my Parse Server backend? I think the cloud functions of Parse Server can be migrated to serverless functions since they are triggered by HTTP requests, but I do not know how to achieve it, and failed to find a tutorial about this as well. I even failed to achieve the first step to initialize Parse Server. My code (index.ts) is like: ```js...

error 1101

How to resolve this
No description

sveltekit app deployed on cloudflare. will it become slow as project size increases?

When sveltekit runs build command, it outputs _workers.js file containing all the server code in one file. Mine at present is 980kb. And i expect it to grow as i add more code. 1. Does the request response become slow as the size increases as this huge script has to load on every request. 2. And i saw in docs the workers size limit is 1mb for free tier. Is it the same for page functions?...

Workers: watermark images hosted on Cloudflare Images

We're trying to apply a watermark with a simple worker script. Code is taken from documentation. It seems that worker's fetch method completely ignores cf.image options. It just returns original image without any modification. It seems a lot of people have this problem. Is it even possible to apply a watermark to an image hosted on Cloudflare Images? Without this feature we would have to store twice the amount of images, and it's a no-go for us....

I cannot pass `env.MYBROWSER` as an argument to `puppeteer.launch`.

I have a question regarding TypeScript and trying to use puppeteer. I am encountering a type error. In the following sample code, I cannot pass env.MYBROWSER as an argument to puppeteer.launch. ```typescript import puppeteer from "@cloudflare/puppeteer"; interface Env {...

Browser Rendering Error: 429

Hey, I have a simple browser-rendering API worker (code below). But I frequently get this error: Error: Unabled to create new browser: code: 429: message: Too many browsers already running It happens locally when testing with —remote but also in prod. I had to switch my backend to another service as my tool went viral this weekend. ...

TCP Socket does not seem to work on Worker

I have created a new worker using the example on https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/#connect (also below), under https://connect.fifo.workers.dev When trying to access https://connect.fifo.workers.dev/gopher/wbgopher, it takes a long time and just returns a blank page. It seems to stuck at responding with the ReadableStream from socket....

Does the local runtime support streaming response?

When I deploy, the page can respond with streaming, but the page render at same time when it locally through dev. https://flat-wood-88f1.269476124.workers.dev/ This is my Code :...

[ERROR] Error: No such module "chunks/pages/buffer".

I'm getting a [ERROR] Error: No such module "chunks/pages/buffer". error that I cannot for the life of me debug or source where it's coming from. My application is an Astro Pages app that definitely makes use of Buffer on the server side and I've tried bot stubbing in a buffer package as well as using compatibility_flags = [ "nodejs_compat" ] all to no avail. I cannot get past this issue when running a function that utilizes the Buffer package. Here's what my current astro.config.mjs looks like ```mjs...

Way to respond with multiple images from text to image models

I am want to respond with two or more images in a single response I tried to use encodebase64 from hono but that just returns an empty string here is my route. ```js avatarRouter.get("/", async(c) => { const body = await c.req.json() const ai = new Ai(c.env.AI)...

Image to Text with Workers AI.

Hello! I'm testing out some options for creating image alt text using AI. Most API endpoints I've trialed take a image URL string as the input paramter. The cloudflare API JSON schema is unfamiliar to me - where am I passing the image here?...

Can not enable Log Push

I can not enable logpush even though my user is a super admin and I am using Paid Workers. I also do not have a logs menu under Analytics and Logs side menu.
No description

handler does export fetch() function

Wonder how to fix this error? I ran just right after scaffolding the project with c3 cli. Also added --test-scheduled=true but still doesn't work
No description