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

Vitest type error in Github Actions and eslint

error: Cannot find package "cloudflare:test" from "
error: Cannot find package "cloudflare:test" from "
For some reason in both Github Actions and eslint it's failing to load the types, with the above error for both....

Workers Websocket Send Message on External Event

Hello! I'm looking for an elegant solution (if possible) to run a websocket and simultaneously allow external events to be sent to (all) websockets e.g. when a POST request is sent to the worker. Situation: I want to run a websocket (easy part) and have it be able to send messages when a separate request or event happens outside of that websocket session (hard part). I thought about using a queue and having the websocket listen for messages on the queue, or maybe having a global state or event emitter or literally anything but I can't think of a very good solution to this problem. Any suggestions?...

Any recommendation for a good boilerplate for Workers project?

I understand this is quite subjective, but there is a world between the cloudflare-create samples and something actually useable. I'm interested in a starter app similar to the task one, but with JWT Auth and Database integration?...

Can I send something over UDP with Workers?

Basically trying to port https://github.com/zegevlier/mcping over to Minecraft Bedrock which uses UDP as protocol, just not sure if this can be done on Cloudflare Workers.

Worker not finding module when "node:" prefix is used

I'm trying to import an npm module, but if I try to import it with the "node:" prefix as the docs say, I get a "no such module" error. If I remove the "node:" prefix though it is able to find the module but then of course it has compatibility issues, so I assume this isn't what I want. How should I be importing the module? I have enabled nodejs_compat in my wrangler.toml file...

fetch for Anthropic Claude3 never returns

Hello I trying to send a large prompt to Claude3, 66000 (characters) with the below code. After starting it never returns and I get no error back. - If I run the same code with a small prompt (100 characters) it works. - If I run the same code in a node.js or python app with (66000 size prompt) it works fine....

Started getting error [code: 10004] after removing sentry integration

When I try deploying my worker using wrangler I get the following error: ``` wrangler deploy -c wrangler.toml (base) ⛅️ wrangler 3.41.0 (update available 3.48.0) -------------------------------------------------------...

storing stateful WebSockets connection

Hey everyone, so, I am just learning that "stateful objects" can not be stored in a Database, like D1 or any other Database. KV won't work because it can only store string values. I'm learning that stateful connections in programming are stored in the memory of the running application....

Response time is too high, logs shows it is just 1/15 time, no idea how to debug this case

Hi My request is taking much longer than expected (1.5 seconds in Chrome DevTools). I calculated it e2e should only be around 100ms. I've tried reloading the page multiple times, but the result is the same. Any idea what might be causing this slowdown? Account id: 5c6fbc8f1990d244d873173b28cc8381...
No description

Notifying big number of clients about R2 file changes

I have a R2 bucket that one client uploads files to using a Worker. Then, I have a couple 1000 other clients that should be informed about these changes as soon as possible (within 10-60 seconds) so they can download the updated files. What would be the best way to achieve this? Currently I have the clients poll for changes once a minute or so, which works but doesn't really scale well. I need a setup that works well with 1M+ clients :NyanThinking:...

Worker "isSecureContext" is set to false locally

Hi! A library that I'm using uses the Web Crypto API which checks (!globalThis.isSecureContext) which fails while developing locally. It seems like worker's aren't running in a secure context. Is there some sort of setting that I need to change which will fix this?...

Simple RPC between 2 workers results in `Unknown Event - Canceled @...`

Here's what I'm working with: Here's a sample of the RPC WORKER ``` // wrangler.toml...

Any way to run code once on deploy?

I'm currently developing a discord bot that, due to only needing to handle slash commands, will run on a cloudflare worker. Is there a way to run a part of the worker only once right after deployment? I need that to update the commands on discords end. I can do it in the github deployment, but since I can't get node to allow directory imports and imports without ".js"at the end (using typescript), I would prefer a cloudflare-native approach

Cloudflare Calls: Recording

I can't find any documentation on storing Cloudflare Calls streams into Cloudflare Streams or R2.

Reverse Proxy syncing config database

Hello! My goal is to keep the internal (in memory) config up-to-date across all workers and propagate the remote db changes effectively. So, I have one Worker acting as a reverse proxy that process requests with fetch....

Cloudflare Expert Needed for Webflow & WordPress Integration

Need help in troubleshooting and resolving a specific issue we've encountered while integrating our Webflow site with a WordPress blog hosted under a subdirectory. Despite following a comprehensive guide and achieving positive results in the Cloudflare dashboard preview, we face a challenge with Webflow 404 error pages appearing for our target URLs upon live deployment. Flow www.domain.com is hosted under WordPress. Now we want to host our Product pages under Webflow & keep blogs under WordPress within www.domain.com/resources sub-directory. ...

R2 multipart upload complete function is taking a large amount of cpu time.

When looking at the metrics for our worker that handles file uploads we are noticing that the "complete()" function of multipart upload is spiking the cpu usage, is this expected behavior given that the work should be carried out on the R2 infrastructure not on the worker end?

Want to host product pages on Webflow & Blogs on WordPress

Hello all, We're in the process of integrating our new Webflow site with an existing WordPress blog under the /resources subdirectory. Despite trying various methods, we haven't found success and keep running into issues. Would love to connect with anyone experienced in Webflow-WordPress integration for some guidance or assistance. Any help or pointers would be greatly appreciated!...

How does the caches.default interact with fetch by default?

In the screenshot (https://developers.cloudflare.com/workers/reference/how-the-cache-works/#cache-api) it says that the caches.default is the same one that fetch requests use. Does that mean that if I use fetch function for making network requests, they are cached by default? I am asking cause there is one external API I'm hitting and it's probable that the backend makes the exact same request multiple times within a few minutes. Do I need to use the caches manually or is automatically enabled in the fetch request? I'd assume it's not cause by default you shouldn't get stale data, right?...
No description