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

Next.js + D1 + SSG .. would that work?

Hi, not sure if this has been answered before .. also posting my first ever message on discord.com I am building my app with Next.js and Deploying it to Cloudflare workers. I am trying to build SSG pages using data from D1 .. will this work? When the query to get the slugs is executed, I get "Error: D1_ERROR: no such table: blog_posts: SQLITE_ERROR" when workers build is running...

Queue stuck until manual Send Message from Cloudflare Dashboard

Recently, my queue frequently stuck. This is the producer code (never changed since forever): ``` router .post('/nudge/jobs', async (req: Request, env: Env, _ctx: ExecutionContext) => {...
No description

Anyway I can lookup username:email format in KV using worker (without list) ?

For example, i have a format username:email if user logins with their username it can use READ and able to get username even with username:email format, however, with email I can't manage to get the email prefix...

How to update Worker secrets via REST API (or TS SDK)?

I found such undocumented endpoints in wrangler's source code: - To create and update Worker's secret: https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/workers/scripts/<WORKER_NAME>/secrets - To delete Worker's secret: https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/workers/scripts/<WORKER_NAME>/secrets/<SECRET_KEY>...

How do i get IPv4 in worker

I’m trying to retrieve the IPv4 address in my Cloudflare Worker, but both x-forwarded-for and cf-connecting-ip only return an IPv6 address. However, when I open https://www.cloudflare.com/cdn-cgi/trace directly in my browser, it shows an IPv4 address, but this doesn’t happen inside the Worker. Any ideas why?

namespace is not valid

Hey I'm trying to deploy a new worker project which just has 1 binding to a KV. It works locally, but when I deploy to CF I get this error:...

Executing Cron with random delay

I was wondering what the best way would be to have a cron job run every hour and then have some random variance as to when it executes. My idea was to do the following: - setup a cron trigger to run every hour - the worker awaits a promise with a timeout that resolves with some random time (e.g. 30min) - do work (I'm just running a request and storing that into KV) - finish ...

hono static files return 404 in wrangler dev and worker when in subdirectory of assets folder

Hello, i am using hono with a cloudflare worker to serve the asset folder 'assets' as seen in the examples: ``` <p> Try visiting: <a href="/my-file.txt">/my-file.txt</a> and <a href="/folder/nested-file.txt">/folder/nested-file.txt</a> </p>...

Advice on how to use hyperdrive externally

From my understanding hyperdrive is meant to only accept traffic within the cloudflare network e.g workers I am looking to access the hyperdrive connection string externally to lessen my latency, however that requires some work around How would I approach this? My current idea is a worker that somehow can route requests to the hyperdrive and have it's own public connection string of sorts however this is unlikely, as postgres in itself requires a TCP connection which afaik workers don't support...

Error: EMFILE: too many open files, open '/opt/buildhome/repo/node_modules/lodash-es/lt.js'

``2 (node:2287) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. 14:49:54.472 (Use node --trace-deprecation ...` to show where the warning was created) 14:49:55.274
14:49:55.275 node:internal/event_target:1090 14:49:55.275 process.nextTick(() => { throw err; });...

Caches is randomly deleted

Hi, I don't know why, but my cache is set to public, s-maxage=31536000, immutable, and it still expires randomly after a few hours or a day. Any insights about this? Tried searching google but doesnt found any good info I'm certain about this as I checked > 10 times, open devtools to make sure it's removed The logic is simple; I copied it from the doc's example. ```js...

Regression in Browser Rendering: PDF timeout

When generating PDF:
TimeoutError: waiting for Page.printToPDF failed: timeout 30000ms exceeded
TimeoutError: waiting for Page.printToPDF failed: timeout 30000ms exceeded
...

Error 525 when fetching Let's Encrypt API

I'm trying to call the letsencrypt API from a scheduled worker (cron), and I'm getting an HTTP 525 status code only in the worker, it works fine locally. Just a simple request to https://acme-v02.api.letsencrypt.org/directory using fetch is all you need to repro. If it helps, here's some of many ray ID from the response headers: 91c7bf13c1322f93-MAD, 91cdb4de8635ede7-LHR

Email worker doesn't work, logs and tail are empty

I have a very simple worker: ```ts export interface Env { EMAIL_TO: string; WEBHOOK_ID: string;...

I can't create and set new token from Workers Settings

Hello, I am having some issues with Cloudflare Workers Builds Settings in the dashboard. When I try to create a new token, I get this error.
- These rules must pass for `{ "act": "user", "sparams": "tokens", "name": "Workers Builds - 2025-03-07 13:50", "scopes": { }, "permissionGroupKeys": { }, ... }` - policies must be present"
- These rules must pass for `{ "act": "user", "sparams": "tokens", "name": "Workers Builds - 2025-03-07 13:50", "scopes": { }, "permissionGroupKeys": { }, ... }` - policies must be present"
...
No description

Worker build error

I have been running into worker build error for last couple days. As soon as i setup the project to deploy from github repo, i get this error. running wrangler deploy locally works just fine. I had the same repo deploying just fine, had some config changes and repo migration done from one org to another. Deleted previous worker and trying to re-configure new worker. Been running into this issue ever since.
No description

[observability.logs]logs enabled cleared on build

Anytime I build my workers logs are getting disabled. I have this set in my wrangler.toml ```...

R2 Presigned URL : No upload limit ???!!!

Hey everyone, I'm using presigned URLs to allow users to upload files directly to my R2 bucket, and I noticed that AWS S3 allows setting a content-length-range condition to restrict file size. However, I couldn't find any way to enforce a max file size limit in R2's presigned URLs. Does this mean that anyone with the URL could upload huge files (even terabytes) to my bucket????!!! If so, what's the best way to prevent this? Any official way to enforce size limits at the R2 level?...

Expected latency difference between workers.dev and custom domain

I have a very simple /ping worker. I get ~85ms for a round trip to workers.dev, and ~50ms for a round trip to my custom domain. In general, is this expected, and if so, does anybody know the underlying reason why there's such a big difference?

How can I increase the number of custom domains supported by workers/pages?

I have a SaaS and my clients' customers can add a custom domain. Workers/pages support up to 100 custom domains. Is there any way to increase this limit?...