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

Are there TS types for rate limit function in @cloudflare/workers-types or other package?

I am implementing rate limiting and wondering if cloudflare ships types for this? Or should I create my own types temporarily?

logpush

Hi All, I just enabled logpush (account -level) for my worker. I can see the logs being pushed to r2 with extensions as .log.gz. On decompressing the file, the data is gibberish. It seems like the logs are encrypted but I can't seem to find any documentation related to it. Has anyone run into this issue?...

Cannot make D1 requests twice?

I am facing a strange issue where I am unable to make D1 queries multiple times. Here is the code I am using ``let sqlQuery = SELECT sura, aya, text FROM en_pickthall WHERE 1=1 ; keywords.forEach((keyword, index) => { sqlQuery += AND (; sqlQuery += text LIKE '% ${keyword} %' `;...

Worker replaced by Cloudflare snippets

I currently have a worker that we use to route our traffic to old and new applications depending on the path. I made a Cloudflare snippet that does the same and it's quite easy to manage. Snippets are made for that?

Error: D1_ERROR: near "MERGE": syntax error at offset 3

```sql MERGE INTO pt_player_tribe AS target USING (SELECT ?1 AS player_id, ?2 AS tribe_id, ?3 AS world) AS source ON (target.player_id = source.player_id AND target.world = source.world) WHEN MATCHED AND target.tribe_id <> source.tribe_id THEN...

✘ [ERROR] Error: The 'mode' field on 'RequestInitializerDict' is not implemented.

✘ [ERROR] Error: The 'mode' field on 'RequestInitializerDict' is not implemented.

worker return blank page when i change the hosting

i have configure worker to do ip redirection base on location this worker returning blank page since i change the hosting.. no error no thing just blank page.. plz i need help and i am willing to pay...

Add Workers Admin User

Hey, Can I add a user as an admin only on the workers? When I try to add the following permission to it: Cloudflare Workers Admin I get an error, I have attached a picture of the error....
No description

Rate Limit not limitting

I have a simple worker that reads an API Key from D1 and shall use the rate limitter to apply limits to it. I've configured a very small limit in my config to test it: ```toml...

Requests from Algeria are being handled by France edge server

Worker keeps redirecting requests from Algeria (Algiers) to the France edge server instead of the Algiers or Annaba edge server. Any solution to prevent this from happening?
No description

I'm on the Workers Paid plan but I can't access Workers Trace Events Logpush, why?

I've Super Administrator role and my account have the Workers Paid plan. Here https://developers.cloudflare.com/workers/observability/logging/logpush/#via-the-cloudflare-dashboard it said:
- Log in to the Cloudflare dashboard, and select your account....
No description

Trying to use D1 for my project. But getting an error

Hello everyone. I am new to cloudflare stuff and started experimenting with workers. Im trying to publish a Pastebin like app so I can store pastes in it and share those. https://gist.github.com/frontlineroleplaysrilanka/7e8e8f39e214f49603f2407693b25caa ...

Reflecting user's region

👋 I'm experimenting, and trying to create a worker that simply reflects the requester's region back to them. Like this: ```js export default { async fetch(request, env, ctx) {...
No description

Unable to bind durable objects on Remix + Vite project

Hello, I'm trying to incorporate a durable object into my project that I have recently moved to Vite (from the classic Remix compiler). However I think this issue may be more relevant to Wrangler due to the nature of the error. I'm on MacOS and using Node 21.6.2. When running wrangler types (which in turn runs my Vite build process): ``` % npx wrangler types...

How to abort realtime connection when request ends?

I'm building a realtime chat app, and evaluating Ably to use as a Pub/Sub solution in my worker (I have a GraphQL subscription that subscribes to incoming pubsub messages from Ably, does some processing to the payload, then passes it to my React frontend). I noticed that (at least when testing locally) every request would start a new Ably connection, and it wouldn't disconnect. Hence I hit my peak Ably connection limit whilst I was developing. Can you help me resolve this please? I'm using GraphQL Yoga server, but here is a simpler example to reproduce the issue. Note I attempted to add code to detect the "abort" signal, but it's never getting triggered. ...

D1 is empty

Hi All, I am facing an issue using D1 locally. The issue is my worker cannot see any of the DB objects I have created. First, I setup my DB with some DDL: wrangler d1 execute appdb-dev --local --file=./1.sql...

Gemini API in cloudflare worker

Getting an error while using free gemini api from google ai studio in cloudflare worker
(error) Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:streamGenerateContent?alt=sse: [400 Bad Request] User location is not supported for the API use without a billing account linked.
(error) Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:streamGenerateContent?alt=sse: [400 Bad Request] User location is not supported for the API use without a billing account linked.
...

Is there a way to selectively turn off passThroughOnException?

Given the following code snippet: `addEventListener('fetch', (event) => { event.passThroughOnException(); event.respondWith(handleRequest(event, start)); });...

Prisma webAssembly error

Hi, I was trying the prisma orm, however I am facing the following issue when I deploy my next.js site to cloudflare pages. Any idea how can i fix this? ▲ ./node_modules/.prisma/client/query_engine_bg.wasm 07:46:33.116 ▲ Module parse failed: Unexpected character '' (1:0)...