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

Email Worker to webhook POST fetch not working in production

Hello, I am trying to send a POST request to a webhook after receiving e-mails, using a Worker. This works in the edit environment; the webhook receives the POST request successfully. But as soon as I publish it live and send an e-mail to it, it doesn't do anything and it tells me Delivery Failed. I have looked at <#1185774979082637432>, and am doing the same approach. (The forward does work though if RegEx is not matched.) Here's some screenshots:
No description

Dynamic Site with Workers

I currently have a worker which handles post requests for the root path and uses a database and a kv namespace. The context is a discord bot that handles the interactions only via webhook. Now I want to build a website for it (like a dashboard) and, since it needs to use the same bindings and data, I was thinking to use the Worker so that I can integrate everything. I discovered Workers Sites but I see that for new projects it recommends to use Pages. I never used Pages before but obviously it wouldn't be a problem for me but now I'm unsure what to do. I've considered - using Workers Sites to integrate everything into the existing Worker - using Pages to host separately the Worker and the website - using Pages to host both the website and the main POST handler (is this even possible?)...

Worker fetch will not use the system proxy

Describe the solution When I run wrangler dev for local development, I have configured the environment variables as follows: ```bash...

create a worker through dashboard at same host & url as a sveltekit cloudflare Pages app

I have a pages sveltekit app. I want to create a worker for rezising images, but can't get it running inside the app. I therefore want to create a separately worker using Cloudflare Workers, talk to it through an API inside my sveltekit app. I want to create the worker script through the CF dashboard. My quest is, how can I host that worker at the same host / domain / URL as my svelte pages app? And put it at /image-resizing, for example, under root. Instead of at a separate domain, which is where im getting directed by following the "create worker" button at Cf dashboard...

Fetch origin using worker endless loop

I'm trying to do something using a worker on a route before passing the request on (to cache, origin, etc.). I think I should be able to just call fetch() on the original request, but that puts me in an endless loop of the worker calling itself.
Can someone hit me on the head real quick? :NotLikeThis: ```Javascript...

websocket when added "upgrade" header, not being sent in headers while api is called

client code:- let resp: any = await fetch("http://127.0.0.1:8787", { headers: { Upgrade: "websocket", },...

Working examples of streaming to r2 inside of a worker?

I'm working on an upload api that takes in a body, and sends it to r2, but needs to scan the data as it's coming in. We can't hold this in memory due to worker limits, and the cloudflare docs state: "To ensure memory usage does not reach this limit, consider using Streams." but only link to the streams APIs. Curious on if anybody has working examples of how to do this in a worker? We keep getting the error: Error: The script will never generate a response....

Workers-wasi

Hello, I'm interested in adding the poll_oneoff funtionality to workers-wasi (https://github.com/cloudflare/workers-wasi) to be able to compile code from some languages to wasi. It seems that Docker build is failing when I'm trying to compile libc, which is a dep of wasmtime (https://github.com/cloudflare/workers-wasi/issues/29). I've tried to update wasmtime, and that seem to fix the issue, but I have another issue with missing tests in the ./build directory now. Is worker-wasi in development still? Do you mind to help with fixing a Docker build to accept future contributions to the project?...

Can you edit wrangler.toml from the online IDE?

I don't want to install wrangler... How do I configure the wrangler.toml in the built-in VS Code IDE on the browser? Thank you!

RPC + cron?

Hey folks, I'm trying to add RPC to a worker that already has a scheduled handler for cron. It looks like inheriting from WorkerEntrypoint messes up any other method such as scheduled..?

How to use a worker to download an image into R2

Hello, My team and I are using a worker with the itty-router to act as a small server. We have a requirement now where we need to get a list of urls, take those urls and download the images to our R2 storage. We're trying to do it now but when we try it looks as if our fetch doesn't even fire at all. Here is a code snippet....

How buy Magic Network Monitoring

Hello. I am interested in a quote, we are an ISP.

create-cloudflare template issue

Hi. I'm having issues attempting to create templates provided in quickstarts. I have tried many other templates which also dont work. ...

Real-time API

Hey all, is there a way to publish real time messages over WebTransport & WebSockets over Cloudflare services or do I need an own backend? Low-latency would be nice....

Incorrectly saying I have unpaid invoices when creating a new website.

I have an ongoing issue for over a month. When I try to add a new website and select the free plan, the following message appears in red in the notification toast popup. It is impossible to setup a new domain as a result. I have an open ticket with Cloudflare support, #01007138, however have received no response. You cannot add or modify subscriptions or services until all invoices are paid. Download each "Unpaid" invoice on your Billing page and click the "Pay online" link within each invoice to fix your account (Code: 1323)...

puzzling waitUntil warning

For the life of me, I'm not sure what part of my code is causing this. The result appears to be a handful of openai calls that are immediately failing, so I'm doing something wrong. I've bundled my async code into a single function which returns via return Promise.all(promises) to ctx.waitUntil() in my fetch. Running it locally (see screenshot) is also indecipherable....
No description

vite-tsconfig-paths throws error when used in Worker vitest config

Hello, I'm using custom paths inside of my tsconfig, I've tried to make Vitest compatible with them using the vite-tsconfig-paths plugin however it consistently gives me this error .. ``` āœ˜ [ERROR] "vite-tsconfig-paths" resolved to an ESM file. ESM file cannot be loaded by require`. See https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details. [plugin externalize-deps] ...

Access D1 database outside a request

Hello, I am trying to configure a D1 database for my Cloudflare worker. I have already created the database and added it to
wrangler.toml
wrangler.toml
. In the docs (https://developers.cloudflare.com/d1/get-started/), they say we can access the database like this: ``` export interface Env { // If you set another name in wrangler.toml as the value for 'binding',...

AWS SDK in Tail Worker?

Is it possible to use aws sdks in workers? I see Cloudflare have an example repo https://github.com/cloudflare/workers-aws-template/blob/master/index.js However, when I try to deploy my worker it fails due to the SDK requiring Node APIs under the hood (see screenshot)....
No description