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 patch local Sandbox instance to return correct URLs

When a sandbox is created in the local development environment, it generates a 3000-random-sandbox.localhost URL (via a Durable Object). However, this isn’t a real URL since there’s no subdomain support or proxy running. Instead, Docker assigns static ports — for example, 39300. Now i could just replace the value manually, but if I start many sandboxes ports cannot scale. Why is durable object returning "random" urls, it should return whatever docker returns as exposed value?...

Initializing build environment taking too long / Build failed to initialize and was timed out

Currently trying to deploy a frontend react+vite app where the frontend itself is part of a monorepo (turbo) At first, it was getting past the Initializing build environment environment build stage (first build that triggered when i imported the repo), but i cancelled the build when i realized that i haven't pushed the changes that had the cf vite dependencies, and because I haven't set all of the environment variables now after i have set the variables and pushed the latest code, it just gets stuck at the initial build stage for some reason ( Initializing build environment )....

calling ctx.waitUntil multiple times

According to the document, calling ctx.waitUntil will keep the worker alive for 30s(wall clock) until the given promise resolves. My question is, if I return a ReadableStream in the fetch event, can I extend the worker life time (wall clock) more than 30s by calling ctx.waitUntil multiple times?...

how can I use the env vars in .env when deploying a worker via wrangler?

I have done it before, I ust don't know how šŸ˜‚ I have an .env file on my dev environment and used wrangler deploy - it shipped the env variables in the file as well. However, my current project doesn't do this somehow. Any idea why?...

service binding errors on OPTIONS Request

I have a worker that calls another passing a Request object. When it’s an OPTIONS Request, Cloudflare throws and exeption immediately. But still successfully runs the function in the 2nd worker. After some trial-and-error hacking, I found it’s due to the body: null. If I fabfricate a new Request object without a body, the errors go away. This was flooding our observability/logs with mystery errrors and quite annoying. Is this a bug in the Cloudflare RPC between service bindings?...

Worker Sleep

Can I keep my cf worker sleep 180 seconds and then send response, I have paid plan

KV vs DO

I've been building workers and leveraging KVs to create dynamic content. However, I've come to the realization that how I'm using one of my KVs is super susceptible to race condition issues, so I started looking at DOs. My question is, are there any "gotchas" I should be concerned with when using DOs? Any "it costs more because it uses more ___" or alike? Would using both essentially "double" in transaction availability (not literally but assuming it were balanced) since they each have their own pool? It doesn't seem like too much to transition parts from KV to DO, but I also know I'd be flying blind with DOs without a helper script to query/output, so I'm also curious how y'all handle that....

facing workeers deploy issue ✘ [ERROR] Error creating application:SURPASSED_TOTAL_LIMITS

error - ✘ [ERROR] Error creating application: 16:05:22.040
16:05:22.040 SURPASSED_TOTAL_LIMITS 16:05:22.040 reason This application's durable_object_offset_instances exceeds the allocated quota in this account. 16:05:22.040 used_durable_object_offset_instances 20...

My products Worker KV wont initialize

My products Worker KV wont initialize after correctly setting the binding in the wrangler.jsonc and specify the binding in the dashboard to link to the correct KV environment. I opened a support case, which I paid for, and they haven't got back to me and its 48 hours later. Really disappointed with Cloudflares support for customers....

Paid plan not applied to my opennextjs-cloudflare Worker

Hi, I’m on a Workers Paid plan, but my project deployed with opennextjs-cloudflare still behaves as if it’s on the Free tier. Other Workers in the same account work fine, but only the opennextjs-cloudflare-deployed project shows ā€œAssets: Freeā€ in the dashboard (see attached screenshot) — and it seems to be stuck with the Free-tier 10 ms CPU limit. Could you please check if my account or this Worker isn’t correctly marked as ā€œPaidā€?...
No description

Need help to deploy a full stack nextjs app

hey folks, new to the cf platform have deployed a few static sites on the pages but now when I tried to deploy something more, getting a bunch of errors the app is in nextjs, fetches real estate info from a google sheet ...
No description

Need help with O2O routing issue on Shopify domain.

Worker: romantasy-hub-103125 Domain: romantasyletters.com Route: romantasyletters.com/hub/* Worker loads at: https://romantasy-hub-103125.hello-090.workers.dev/hub...

Help! Deployment Nextjs & React Site

Im trying to deploy a nextjs framework & react site on cf pages but having a lot of error on deployment. Is it not possible to host a nextjs and react project on cf pages?

Worker Zone

Can a worker be related to a specific zone? Or just routes inside the Worker are associated with a Zone? Thanks

NextJS+Wrangler+R2 setup for local development without remote bucket

I'm building a little SaaS app, which I've now got in state that I would like to implement file upload into it. I've successfully implemented that, by having local environment using r2_buckets-binding with remote: true flag. The challenge is that my CI/CD pipeline breaks in github actions, since having that remote flag in wrangler.jsonc file, requires that my Github instance is logged into Cloudflare with my account, instead of using account API key. What might be the proper way to develop and test R2 bucket uploads locally with NextJS, but still being able to setup staging and production environments properly into wrangler.jsonc?...

Build secrets for preview workers

I have a worker that has both variables and secrets in the "Settings" panel for Worker Builds. In production builds everything's fine, but in preview builds, secrets appear empty. To check that I added an env call before builds and logging in the js code. This is what I see: ``` API_BASEURL=https://****/api/ API_SECRET_KEY=...

NextJS + Sentry on Workers ?

I have a website that runs on Workers, I'm premium user. This website is made with NextJS, and I want to add Sentry (or posthog) to get better error messages from the website, if it is possible. I would love to hear if you have just 2 mins to share with me what you made, and so on Thank y'all...

Issues with Worker

I followed Prerender guide to integrate with Cloudflare Worker https://docs.prerender.io/docs/cloudflare-integration-v2. But there seems to be an issue with the worker itself that is not being triggered. The DNS is managed on Cloudflare (both CNAME and A are Proxied). After updating the worker and running a command in Powershell it doesn't pick up the worker. ...

How to deploy multiple workers (≠ domains) from the same repository (multi-tenant app)

Hello, I would like to get a second version of an app i'm deploying on another domain, for another client. The repository would be the same (same code, same branch) I would like to get other environnement variable for this client And each time I would merge pull request on main, it would trigger a deployment using the cloudflare integration to both of the workers...

No user-agent header in OpenNext on CF Workers

Hey! I've just migrated my app from next-on-pages to OpenNext and stumbled upon an interesting thing. All requests coming from the backend part of the app don't have the User-Agent header. Only discovered that it's a problem for me when I enabled a rule on the Cloudflare side to cut off all requests with no user-agent (helps against some bots). I found out that the next-on-pages apps still work fine, but the OpenNext ones are crushing. ...