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

wrangler deployment overwrites env vars in the worker

I'll take the DEEPSEEK_API_KEY env var as the example. I ran the wrangler secret put command to set all vars and then ran the deploy command. Finally, I went to the Cloudflare worker settings page to check the environment variables, and I found that all the variables and secrets were overwritten by the placeholder values from wrangler.toml. I also tried setting the vars directly in the dashboard, but when I connected my github project to the worker and deployed again for further features, I found that placeholder values from wrangler.toml still would overwrite my environment variables. ...
No description

Wrangler deploy missing permissions to read account

I'm trying to deploy a very basic project. wrangler.jsonc: ``` {...
No description

routing emails to email workers

Continuing conversation with Sunil on twitter DM I've now done this, "Status" suggests it's not set up yet, ``` noop: (502, b'Command not implemented')...
No description

Websockets with Workers

Howdy y'all! I have a worker that is functioning as a websocket server. Everything works fantastically: - locally / in dev - in production if I use a CLI to interact The second I wire up a browser to it, things start failing though. And what's worse, the failing has almost no details anywhere that I can find. The connection succeeds and then immediately closes. No logs on the backend, and logs on the frontend are code 1006 ("i dunno what happened"). ...

Several questions about developing locally with queues

1. The Get started guide for queues suggests running wrangler tail to watch published messages arrive. However this gives an error 10007 when working locally. Should this command work locally? 2. How does one configure the batch size/frequency of a queue when working locally, since the queue is automatically-created by Wrangler? That is, you don't run the create command when working locally, nor do you bind the queue explicitly to your config TOML/JSON. 3. In my consumer handler, I have: ``` async queue(batch, env) {...

Panic Internal Error when Build

So this error happen when i use vidstack/react library with nextjs15, i want to deploy nextjs to worker with opennext The error only show panic: Internal error (while parsing ".open-next/server-functions/default/handler.mjs") ...
No description

[wrangler:err] TypeError: Parsing a Body as FormData requires a Content-Type header.

I believe this error is happening at request.formData() below and I'm just trying process the request from a basic html form with a few input fields and has theapplication/x-www-form-urlencoded content-type header, so I'm not sure why its throwing the error ```export default { async fetch(request, env, ctx) { await request.formData().then(async (formData) => {...

Is it possible to run headless Playwright in Workers?

Is it possible to run headless Playwright in Workers?

Cant Preview Worker using queue in Pages functions

I have a CF Pages project that use a endpoint with Functions to bind form submits to a Queue. This Queue is consumed by a Worker that saves the messages in a D1 DB. And every 2 minutes the same worker get the messages in this D1 DB and send to a external API. Everything is working just fine. But i cant figure out how to have a Worker preview, or even run the worker locally using this flow, to test before merging to main....

Image transforms via Worker/Workflow not working

I'm encountering a strange issue where my image transformations aren't working at all. I have a pretty basic request, fetching an image from an external domain. I can confirm that the Cf-Resized header is null and the Content-Type header is un-changed (image/jpeg). ```...

Cannot login using cloudflare link

I am continuously login Cloudflare using browser with the link it provides, but not able to do so. I get this page each time.
No description

Worker Logging, Bytes Sent

I am trying to troubleshoot a worker and need to know how many bytes was sent for each request, especially when the request is canceled by the client. I am trying to implement some debugging g logging in hono middleware, and cannot find a way to either get the info from Cloudflare, or make some sort of “proxy” stream to capture bytes read before client disconnects. I tried going with TransformStream as intermediary, but get “Body has already been used. It can only be used once. Use tee() first i...

Duplicate log from RPC

I set up log push from my RPC to a HTTP log push job, i noticed each log from the RPC is duplicated, i think it's a bug.
No description

How to create a binding TS types from RPC worker?

https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/#example--build-your-first-service-binding-using-rpc Following this typescript example, wrangler types creates an interface Env with type WORKER_B: Fetcher. This leads to bad typing when I want to call WORKER_B.add(). How this can be improved?...

wrangler is not working properly due to EOF error.

Create-Cloudflare works and the project is created, but when I hit the bun run dev(wrangler dev) command I get an EOF error. - error(console): ``` $ wrangler dev ...

Receiving webhook in a worker and sending it to the frontend?

Hey dear Cloudflare dev's, I receive a webhook from Mollie and want to forward its data to my frontend. As I understand, since workers are stateless, I can't share variables between functions eg. a global let webhook-data variable. My current approach stores the data in Cloudflare KV and then polls it to send via websockets or server-sent events, which feels overly complex and has it's own pitfalls....

Returning an RpcTarget from a WorkerEntrypoint shows `never` for method return types

This goes off the back of a question I asked in another channel. (if you scroll down there's some more context you can piece together) To give the TL;DR, I need to expose the methods on a durable object through an entrypoint so that I can call them from a different worker. A really neat way to do that is to define an RpcTarget on the durable object which then gets returned through a method defined in the entrypoint. Here's the repro i've been working on This works if you're fine ignoring types. If you do care about types (which I do), there's a problem with the signature of the function when calling the DO's rpc target from the consuming worker. If you try and pass anything more complex than a scalar value from the rpc target and then again through the entrypoint, it'll set the return type to never on the consuming worker which isn't desired (i.e. instead of () => { foo: string }, it returns () => never example)...

Cron Trigger every 10 seconds

does workers platform support cron trigger at the seconds interval? Trying to set a scheduled trigger every 10 seconds

Every time I deploy it fails.

log: ```
21:07:57.383 ✘ [ERROR] A request to the Cloudflare API (/accounts/468fd451dc95ea80709b445130686974/workers/scripts/dev-il/domains/records) failed. 21:07:57.383
21:07:57.383 An unknown error has occurred. If this error persists, please file a report in workers-sdk (https://github.com/cloudflare/workers-sdk/issues) or reach out to your account team. [code: 10013]...
Next