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

Upload Cloudflare Image from Workers?

It's not obvious from https://developers.cloudflare.com/images/upload-images/ how to upload images from a Worker. Is it by URL? Considering other services have bindings, I'm thinking there might be something similar for Image.

Error after running command - npx wrangler pages deploy dist/ error happens

```:sparkles: Compiled Worker successfully Your worker has access to the following bindings: - D1 Databases: - DB: test (e501084c-f3f4-423e-a47d-8d829c92bfe7) โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ...

I get 'undefined' when i get a certificate from the mtls_certificates

I am trying to call/fetch a url and pass along a certificate as described here: https://developers.cloudflare.com/workers/runtime-apis/bindings/mtls/ I uploaded the certificate to my worker and i already added the following to the wrangler.toml mtls_certificates = [...

wrangler dev --local refuses connection after invoking tRPC requests on macos

Hello. We have a very bizarre issue with macos. When we run wrangler in dev mode initially everything works, but after hit some endpoints with tRPC, wrangler breaks. Then I cannot fetch anything from wrangler, and the console isn't saying anything. It just refuses the connect. This only happens on our macos machine, the linux machine works fine. Additionally --remote mode works fine....

Cant deploy worker using router class

Hello, I am trying to deploy a worker that uses a custom router but wrangler keeps throwing the error The uploaded script has no registered event handlers. [code: 10068] Which seems weird because the router has an async fetch handler and is the default export. From everything I have read, this should work? Am I missing something? I also tried extending the class using WorkerEntrypoint but it results in the error Uncaught TypeError: Failed to construct 'WorkerEntrypoint': constructor parameter 1 is not of type ExecutionContext'. which is odd because looking at the docs examples, a constructor shouldnt be needed....
No description

Migrating an old worker to module format

Hi, as far as the worker code goes, I have updated my old worker to use the module format, but I don't understand how to tell CF it is now a module format worker. I haven't used Wrangler to create the worker, it was done via the dashboard
No description

Workers data transfer pricing?

Does anyone know the cost of data transfer for Workers? I've read through https://developers.cloudflare.com/workers/platform/pricing/ but don't see any mention for data transfer pricing except for the deprecated pricing models...

websocket request to durable object does not contain upgrade header

I have a weird issue. I deployed a project using durable objects to namespace.name.workers.dev and setup a worker route to a domain (ie. example.com) Everything works fine on the workers.dev domain, but when trying to connect to example.com it doesn't work with the error below. I've confirmed the browser is sending the header, but it's not being received by the fetch handler....

Timed out in deployment

Hi everyone. I am new to Cloudflare workers. I was making a new app for the CloudFlare workers for my backend. When I was waiting for it to deploy it says this: Waiting for deployment to become available โ”‚ timed out while waiting for {URL}- try accessing it in a few minutes. โ”‚...

Intermittent `Network connection lost.` exceptions

Weโ€™re getting intermittent Network connection lost exceptions on our prod worker (on paid plan). Yes, it doesnโ€™t always happen. Weโ€™re using Baselime to monitor the worker performance. In Baselime logs, the response status is 200 but with this exception:โ€จ ```js exception: { Name: "Error",......

Problem what Environment variables on Nuxt 3.12.4

When using Nuxt.js 3.12.4 and cloudflare worker together, it seems that environment variables are not applied properly. In particular, Secrets do not seem to be loaded properly. I tried putting some variables in the response for testing, but they are returned as undefined. First, write on the Cloudflare discord....

prisma migrations fail if there are multiple databases

running migrations throws an error if there are multiple databases. ``` โฏ npx prisma migrate diff --from-local-d1 --to-schema-datamodel ./prisma/schema.prisma --script --output migrations/0002_rename_referrer.sql ...

cache.match subrequests

Hey, does the Cloudflare's Worker Cache API function cache.match run a subrequest to the request object when the cache misses? In the docs, I can see that https://developers.cloudflare.com/workers/runtime-apis/cache/#parameters-1 if there's a header called cache.match()? then a subrequest is never sent to the origin? Kinda getting lost here, how is that a valid header name? Thanks for the help!...

migration

My staging and production environments got out of sync and so the [[migrations]] (various new_classes and renamed_classes) don't match. is there a way to just "start again" with respect to declaring DOs? i.e., start all environments back to v1 (or any tag really).

How to define the environment to be used for a worker vitest?

Lets say I have mulitple environments: ``` vars = {CMS_API_URL="https://api.systems", ATI_API_URL="https://import.test.io"}...

how do i create analytics dataset?

https://developers.cloudflare.com/analytics/analytics-engine/get-started/ i like to use this but could not find where i can create a dataset in the interface ? am i missing something ?...

Deploying a worker based on an existing Node project

Hello, Let's assume that I have a working Node.js/Express/TS local server with node modules installed, source code, public files, data files, etc. Is there a way I can add wrangler to it, even by modifying the files, without restarting from the beginning? I didn't see any instructions on how to use wrangler with an already existing project in the docs. Please tell me if I am wrong....

Deadlock in cache.put() - platform issue or am I doing something wrong?

The following worker code results in a deadlock (no response is ever sent to the client), both in a local Wrangler instance and in the Playground: ```export default { async fetch(request, env, ctx) { let myResponse = await fetch('http://example.com/'); myResponse = new HTMLRewriter()...

Using zlib.deflateRaw

Is it possible to use zlib.deflateRaw? When I attempt to I get an Error 1101 Cloudflare page.

Bug in Wrangler - it randomly adds [object Object] to console.log()'d string output

I think I've raised this before but didn't get anywhere. There's a really weird bug in Wrangler (presumably) whereby, when you console.log() something, if it's over a certain lenght (unclear), Wrangler malforms it and swaps parts of it out for [object Object]. So you'll get something like:...