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 send a message to the WebSocket from durable object after opening it

I want to send a message with initial state to all clients that connect to my Durable Object via websocket In the below code where do I send the message to the newly created socket? ``` class MyDurableObject extends DurableObject {...

AI on workers

I have a dataset on hugging face. I want llama to perform RAG on it. How to do this?

Can't access any worker

Title, I've started testing Workers and KV to fetch api endpoints and display data on local tests, for some reason my ip address can't reach any of the workers i create since yesterday (locally or through Cloudflare workers code editor error: connection time out), however any other ip/device is able to fetch the data. I've tried clearing browser/system cache, changing dns records on router, none of these worked. I didn't reach any free limits, so I'm not quite sure what is causing this issue.

wrangler dev --remote - 504 Gateway timeout after 60s

Hello, It is possible that when using wrangler in remote mode there is hard limit of 60s timeout for worker request to process? I have simple hono route that is always timeouting in remote mode but passes in local only mode. I need remote mode for working with browser rendering. ```...

Promise.withResolvers for workers?

Is this supported? I'd have to change the TS config to the right target, but I'm not sure if it's supported. I'm trying to create cross-function messaging so I can have a request handler wait for an alarm to go off before responding (flush interval) in case there's a better way to do that...

Config Build

Hello i can find how to setup this...
No description

Strange workers logs issues

Hello all I deploy sveltekit app to cloudflare workers and notice two strange behaviours going on with logs 1) Each page change on sveltekit app logs error POST is not allowed in this path or no action named default found error, I don't see this anywhere else other than worker logs (local, network tab also tried vercel logs and nodejs vps logs jus to make sure) so I think there is some clash happening with worker logs <> sveltekit adapter ...

Cannot edit email workers. Throws Error 1101

Hi, I have a few email workers deployed, but I can no longer edit them! Every time I try to edit or view the worker it throws Error 1101. Help! This happens for all deployments. Error logs show: Handler does not export a fetch() function. This is relating to cloudflare's worker interface, when trying to edit a worker, not an error my worker it throwing. Seems to be erroring out trying to fetch favicon.ico (again cloudflare, not my site!)

Email worker cannot reply to emails received on a subdomain

Maybe a followup on this https://community.cloudflare.com/t/email-worker-cannot-reply-to-emails-received-on-a-subdomain/719852/1 ? Seems I cannot answer an incoming email if my response email is from a subdomain, even though email routing works and I can see the content of the email and whatnot....
No description

Something broken with establishing websocket connection with Browser as a service provider

We have been using Zenrows with puppeteer running in Durable Objects for quite some time now. But as of 2/6 (and we momentarily saw this issue last week too), we get this error on trying to connect to their wss endpoint on a brand new invocation. We are using the cloudflare/puppeteer package. The error is: ```...

How to test an email Worker locally?

I am trying to make an email Worker, I am using an example, but I have no idea how to test it. index.js: ```js const PostalMime = require("postal-mime");...

I deployed my Svelte site to Cloudflare Workers successfully, But...

But when I open my site on localhost it is just loading. I have been waiting for a long time, it is just loading. How can I fix that?...

Weird build error

``` 14:24:10.311 Initializing build environment... 14:24:19.877 Success: Finished initializing build environment 14:24:20.107 Cloning repository... 14:24:22.546 Detected the following tools from environment: [email protected], [email protected]...

Set Sentry environment with Cloudflare integration

Hey! I'm using cloudflare integration with sentry and I wonder how I can set environment?

Not able to get Logpush events

Hello, I was able to integrate Cloudflare Logpush into my axiom account, its been three days and I am not able to get worker dataset logpush events The test logs are coming successfully but the worker logs are not. These are the things that I have already verified...
No description

Why CF doesn't cache this worker?

Can someone help me figure out why this worker never gets cached: https://oparse.com/api/cache The response correctly sets cache-control max-age=60, stale-while-revalidate=60 (you can see it in the browser inspector)...

Importing Response and Request manually from @cloudflare/workers-types

Hi, I am integrating a workers AI project onto my monorepo project I am faced with this error in the fetch handler I tried various ways to fix it such as import type { Reques, Response } from "@cloudflare/workers-types"...
No description

Best way to handle external API rate limits globally

Hey I want to access an external api through my workers and it has a rate limit of 4 reqs a second, previously I used bottleneck and that worked great for me, but that doesn’t work in serverless environments and I’d prefer not to use redis. Is there a cloudflare option that helps manage this rate limit globally? Not just by region? I was looking at durable objects but just wanted to know if there was another way I was missing like maybe a nice package similar to bottleneck. Thanks!

Build custom rollout mechanism

Hi, I'm interested in building a custom rollout / versioning mechanism against the stored versions of workers. In pages, you are able to point to a specific version of the code at any given time since there is a deployment url for each build. I'm interested in doing something similar with Workers, given the worker versioning that was released more recently, but it seems that those versions aren't available at any time, they are only available if rolled back to. I'm wondering if I'm missing something, or if I'm correct in my analysis that the worker versions aren't currently available to be called at any given time?...
Next