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

API not accessible from android device using workers

We are currently using Workers to deploy our API. However, when attempting to access the API endpoint http://127.0.0.1:8787/ from an Android device, we encounter a "Network request failed" error. Notably, this endpoint functions correctly when accessed via Postman or a web browser, and there are no firewall issues affecting the connection. Also we are able to access the deployed url but not the local url . Could you please assist us in resolving this issue?...

worker-rs: http hello world

```rust use worker::*; #[event(fetch)] async fn fetch(...

Pages setting fail to show

Everytime I click the "settings" tab, there were some errors in the console. I tried many times....
No description

All of a sudden Wrangler keeps opening a browser tab and asking for account access?

This hasn't happened for months - yet from Thursday last week, and continuing today, it keeps doing this. I make a change to my local code, and Wrangler opens a tab showing the attached. Not on every save, but perhaps 1 in every 20. I've clicked the button and got the confirmation screen multiple times but it keeps happening, and even if I just dismiss the browser tab and carry on working it makes no real difference - I can still work and test my worker. Why does this keep appearing?...
No description

Setup Workerd in local dev for sveltekit project

So up until now, i was developing on node and deploying it, but some time I get error after deployment like yesterday, I get "node.buffer not available". So I decided to use workerd in the local dev also. But how to setup? I found docs, suggesting use wrangler for specific worker developement. But how to use and setup sveltekit project on workerd? How?

Slow uploads of files from the client browser to the R2 bucket using a presigned URL.

Hey guys, I notice slow uploads of files from the client browser to the R2 bucket using a presigned URL. Sometimes, the file upload also fails. The R2 bucket doesn't have public access and doesn't have a custom domain. Is this causing the issue? Are they rate limiting the upload requests? Do I need to assign a custom domain? Sometimes, when I send the PUT request to the presigned URL, it hangs and doesn't respond for 2-3 minutes. I tried to test with a 15MB file, but the issue remains the same.

this.ctx.getWebSockets() return array of empty objects

When I run this.ctx.getWebSockets() from my durableObject it returns me an array of empty objects, but I expected to actually receive the websockets, what am I missing?

Exceeding usage limit

Hello, I just received this email saying that I used 90% of my free account limit for workers KV. I was surprised since I'm not doing a big amount of operations so I checked in my dashboard and I noticed that I'm not even near the limit: I have used nearly 1k/100k reads, 4/1k writes and 219B/1GB storage. So, how is this possible? Note that I received a similar email saying that I used 50% of my operations this morning but I thought that it was just an error or something, now that it is saying I'm nearly at the limit I'm a bit suspicious about what's going on....
No description

Google drive index Worker Page loading Problem

I have used Cloudflare Workers to index Google Drive. For the past few days, the pages have not been loading and the download speed is very slow. Could anyone please tell me if there are any limitations on Cloudflare these days?ā€

external css file replace with workers

Hello awesome people, i have created a worker to replace external css. Here is my worker ``` addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)); });...

Deploying with keep-vars not working anymore

Hi team ! I hope you're doing great ? I'm currently facing a issue that broke parts of our prod environments. When using the command wrangler deploy --keep-vars, wrangler is overriding the variables set up by the Script API. It was working well for the past 6 months without any issues, but for the last few days it completely overrides all the bindings that were previously defined. ...
No description

Worker exceeded memory limit.

Today my workers got "Worker exceeded memory limit" warn. But when I use "wrangler dev --remote" to check the memory usage, it only "10mb". Refer to the docs the maximum is 128mb, am I doing something wrong here, is that 10mb is the new limit? Couldn't find any best way to find out Worker's memory issue btw šŸ„² Wrangler dev and "--remote" is the way I use reproducible url: https://api-beta.bannerify.co/v1/templates/signedurl?apiKeyMd5=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855&modifications=%5B%5D&templateId=tpl_6UGcrEz3o3&sign=e314850103d6cd6dd4da06dd4636cee7940b1880627446a30ba8c11f51cdcbc5...
No description

Import #30 "wasi_snapshot_preview1" "sock_accept": function import requires a callable

Hi. I'm having trouble executing PHP WASI under Cloudflare worker and can't understand what is actually wrong. It is always fails with the Import #30 "wasi_snapshot_preview1" "sock_accept": function import requires a callable. Is it some missing support for a standard on Cloudflare end or it needs to be compiled in special way? I would be grateful for any hints on the matter. What I'm trying to achieve is to run php-cgi WASI build from https://github.com/vmware-labs/webassembly-language-runtimes/tree/main/php/v8.2.6 When I try to run wasmtime with the same binary it works without any issues wasmtime php-cgi-8.2.6.wasm -i ...

File baser router in cloudflare workers (like Pages Functions)

Hey, I want to create api with file based router just like in pages functions. Is there any library or example of doing so? I thought about using node to read all files in /routes dir to import them all, but not sure if it's possible.

@cloudflare/worker-types ReadableStream incompatible with TypeScript default

I'm trying to use the body property of a Response object, but it seems like the type declarations in @cloudflare/worker-types conflict with those in @types/node for ReadableStream. I'm a bit stumped as to why TypeScript is looking for types from @types/node. Anyone else run into this issue before? Here's some simple code to reproduce the issue with the default TypeScript starter: ```js const res = await fetch('https://www.example.com');...

Help For A Email Response API

Iā€™ve tried to make a system in normal cloudflare workers to make it send a email through a api endpoint and it never worked can anyone help me on this?

MongoDB integration not working with HONO

I tried to integrate and save data from the backend into my MongoDB database and it says this error again and again
No description

What storage model should I use to validate that an API key is only used X times each month?

I want to vend API keys to users who can call the API e.g. 100 times each month. I'm considering using KV namespaces with $API_KEY=$BUDGET and decrementing the budget by 1 each call, but I'm afraid of the cost of reading and writing to KV for every API call. To improve performance and cost, I'm considering writing API calls to an Analytics Engine dataset, then using cron (e.g. every 5 minutes) to read from the dataset and update the KV namespace accordingly. Additionally to improve performance and cost, I'm considering duplicating the KV data to the Cache API and using that as long as its within e.g. 5 minutes old. This assumes that the inaccuracy within 5 minutes is cheaper than the KV reads and writes would have been. Am I thinking about this right? Or is there a simpler solution?...

Workers for reverse proxy like setup for Webflow sites or other hosted sites.

Hello, just wondering if there are any cybersecurity issues, is Cloudflare responsible for the damages? Is there cybersecurity insurance or anything like that? Webflow has their own cybersecurity insurance, just not sure if me setting up a reverse proxy will shift the liability onto me, or if its not as intrusive as I imagine it to be? Is it more like a layer on top of the hosted site?

monorepo with multiple workers - does each one need a separate worker registry?

I'm running multiple workers at once, and getting the following error: āœ˜ [ERROR] failed to start worker registry Error: listen EADDRINUSE: address already in use 127.0.0.1:6284 Should I set the (undocumented) WRANGLER_WORKER_REGISTRY_PORT env var for each of them, or is it nothing to worry about? šŸ™‚...