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

Migration Pages to Workers

Hi everyone, I need some help with a routing issue after migrating from Cloudflare Pages to Workers. I'm currently migrating my React application from Cloudflare Pages to Cloudflare Workers, and I'm facing a problem with routing. When I access the root URL (e.g., /) everything works perfectly, and I can navigate through the app without any issues — all internal routes are found correctly....
No description

Two Workers + Same Domain + Route Conflicts

I have two Workers that need to share the same domain with path-based routing: - Site Worker: Should handle sub.domain.com/* (everything except API) - API Worker: Should handle sub.domain.com/api/* (API endpoints only) Current wrangler configs:...

Unable to create a Worker with API

I'm trying to create workers using the API. I found the correct endpoint for this but I'm running into a brick wall by getting this error:
Uncaught SyntaxError: Unexpected token ':'\n at worker.js:2:12\n.
Uncaught SyntaxError: Unexpected token ':'\n at worker.js:2:12\n.
Specific error code is 10021 and it points to validation errors but it does not help at all in this case. https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021...

Github and Workers App

Hello, why doesnt Cloudflare link/add my deployments to Github similar to Vercel does? Or perhaps this feature doesn't exist.
No description

Prevent Bots accessing domain

Hello, how can I prevent bots crawling my page? They are trying to reach sites, which I don't use anyway but it's annoyning and also the traffic goes up. Appreciate any help....
No description

Smart placements and "whats used"

If I have "smart placements" turned on for a worker and I run it for say 1 week, it shows me the "potential savings" in a table on the 90th%'s and it seems to be that there is a roughly a 50/50 split on some are faster, some are slower, but the question is, which actually get used here as it doesnt seem to say, do the 50% that are fast on the "close to user" get used with that, the 50% that are faster on "smart placement", use "smart placement". Its sort of clear as mud to me? Obvioulsy I wan...

Possible to Access Worker Invocation/Request ID inside Worker?

I have a worker that sits in front of some API endpoints to handle some business logic. The worker eventually forwards a JSON payload to the API endpoint via a queue. TL;DR; I want to append the invocation/request ID I see in the worker logs so I can better debug between CF and my API backend. Is this Request ID/Invocation ID accessible inside a worker? Thx in advance for the help....
No description

Missing apis for worker versions?

I am working to setup deployment workflows, deploying preview versions with alias. I got everything setup and its working great! However, I cannot find any apis to get, delete or list these uploaded versions. When listing deployments from this endpoint: https://developers.cloudflare.com/api/resources/workers/subresources/scripts/subresources/deployments/methods/list/...

An internal error occurred. Please retry your build. If this problem persists, contact Cloudflare

Hey folks, I've been constantly seeing this in cloudflare builds, in a lot of my CI runs. 🙁 Organization ID: b75ee9798c9c48a874af240b29724270 ID of One example Build with the issue: 8b86c4a4-8f9a-4ce4-941d-459c782e1cde ...

Shared secrets across workers

I wanna build a monorepo of multiple workers and wondering if it's possible to provide the path to the .dev.vars file or its directory in the wrangler config? Something like this: ```json {...
No description

Is it possible to invoke API for a private Worker using HTTP Service bindings?

Is it possible to make arbitrary API requests from the frontend to the backend using the worker's HTTP Service Bindings? In a typical use case, it is known that a request to a worker can be forwarded to another worker. It is also stated that arbitrary requests can be made by providing a fully qualified URL as shown below. via https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/http/...

Recurring Cloudflare Workers Error 1101 with Random I/O Exception

Hi, we are experiencing recurring errors with our Cloudflare Workers and we can’t pinpoint the exact cause. In the browser, this message appears: ...

Workers bot traffic / exposing workers.dev url in production

So I have two workers that I'm using at the moment, one purely for front end (migrated from pages) and one for a backend API/logic. Is this the wrong pattern or architecture? Should it all be in one? I got an email saying my API had a spike in bot traffic, and was wondering how to protect against that - and if I go to production is exposing the workers.dev url the way to do it, or how is it meant to be done?...

Caching a Vercel endpoint using cloudflare workers

We are trying to simply cache a nextjs endpoint hosted on vercel. We are using the standard code from the docs (https://developers.cloudflare.com/workers/examples/cache-api/): ``` interface Env {} export default {...

Workers-KV Slow Response time

Hello I have a Cloudflare Worker that fetches data from a KV store and I am finding the response time of most requests to be quite slow, often taking around 1 second. Please note that I am doing a get and put operation in the worker, this is because I need to get/retrieve a user ID (Key) first from KV then update the data/value. Could there be a better way to find a key and update it without performing the get and put operation? If this workflow is standard practice, are the response times from Cloudflare normal? Please check the following screenshots of some Postman API calls to the Worker, please note the response times...
No description

"Error: Network connection lost" when calling fetch, Works fine in CURL and Browser

So when I call
fetch('https://wslgis.water.co.nz/arcgis/rest/services/Services/WastewaterComb/MapServer/2/query?f=json&geometry=%7B%22xmin%22%3A1752242.4364089235%2C%22ymin%22%3A5939768.593982927%2C%22xmax%22%3A1752548.184522064%2C%22ymax%22%3A5940074.342096068%7D&maxAllowableOffset=0.5971642834777837&orderByFields=OBJECTID&outFields=OBJECTID%2CPROCESS&outSR=2193&quantizationParameters=%7B%22extent%22%3A%7B%22spatialReference%22%3A%7B%22latestWkid%22%3A2193%2C%22wkid%22%3A2193%7D%2C%22xmin%22%3A1752242.4364089235%2C%22ymin%22%3A5939768.593982927%2C%22xmax%22%3A1752548.184522064%2C%22ymax%22%3A5940074.342096068%7D%2C%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A0.5971642834777837%7D&resultType=tile&returnExceededLimitFeatures=false&spatialRel=esriSpatialRelIntersects&where=1%3D1&geometryType=esriGeometryEnvelope&inSR=2193')
fetch('https://wslgis.water.co.nz/arcgis/rest/services/Services/WastewaterComb/MapServer/2/query?f=json&geometry=%7B%22xmin%22%3A1752242.4364089235%2C%22ymin%22%3A5939768.593982927%2C%22xmax%22%3A1752548.184522064%2C%22ymax%22%3A5940074.342096068%7D&maxAllowableOffset=0.5971642834777837&orderByFields=OBJECTID&outFields=OBJECTID%2CPROCESS&outSR=2193&quantizationParameters=%7B%22extent%22%3A%7B%22spatialReference%22%3A%7B%22latestWkid%22%3A2193%2C%22wkid%22%3A2193%7D%2C%22xmin%22%3A1752242.4364089235%2C%22ymin%22%3A5939768.593982927%2C%22xmax%22%3A1752548.184522064%2C%22ymax%22%3A5940074.342096068%7D%2C%22mode%22%3A%22view%22%2C%22originPosition%22%3A%22upperLeft%22%2C%22tolerance%22%3A0.5971642834777837%7D&resultType=tile&returnExceededLimitFeatures=false&spatialRel=esriSpatialRelIntersects&where=1%3D1&geometryType=esriGeometryEnvelope&inSR=2193')
Or any URL for that domain I just get Error: Network connection lost. without any explanation....

Secret "MY_SECRET" not found

I'm trying to use secrets store locally by running wrangler dev --x-remote-bindings but when I try to access my secrets using env.MY_SECRET.get() I get a secret not found error. Note that when I run wrangler dev --remote, everything works fine...

@opennextjs/cloudflare v1.6.3 .open-next/assets/index.html Bug?

I get a clean build in my local dev environment with "opennextjs-cloudflare build && opennextjs-cloudflare preview --port 8789" but the generated file ".open-next/assets/index.html" references the wrong chunk files. Is there possibly a bug here in v1.6.3 (latest as of this writing). For example, .open-next/assets/index.html refers to webpack-b0bd85f5ab45543e.js. However, this file is not in the build; rather, webpack-57c771ad3d897bce.js is there instead (in .open-next/assets/_next/static/chunks/). I chose the webpack file for this example because there's only one of them. I'm also getting this error for about 30 other chunk files. The browser gives me a 404 error for webpack-b0bd85f5ab45543e.js and renders nothing, and the curl command shows a 404 as well but returns a bunch of unrelated gibberish. The browser pulls up webpack-57c771ad3d897bce.js correctly, as does curl....

*previewurl.workers.dev : how to disable from wrangler.toml ?

hello, I found that we can disable the main workers.dev domain
workers_dev = false
workers_dev = false
, but not those "preview" one. I cannot find the way to do it from wrangler.toml unless by triggering the dashboard api. is there a way to do so inside wrangler config file ?...

worker and favicons

i have my title set up in the html file and the image files for the favicons are in my github repo but the images themselves are not appearing in the final build
No description