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

Remote Dev

In the past, I had to import miniflare explicitly and check if it was in dev for setting access to D1 under dev. The new project I started to test wrangler/miniflare 3 does not need that and it works well, but it is always local.

You can point a Worker at the local

You can point a Worker at the local bucket, then have the Worker itself serve the API

HTTP Header size limit

How do I change the max http header size for miniflare? The node configuration flag does not appear to work (node 20.11.1). Is there another option needed? A little digging showed that undici could potentially be causing issues but I wasn’t sure if that mattered within workerd or not

@MrBBot I'm trying to use a WASM binary

@MrBBot I'm trying to use a WASM binary with the Miniflare API but running into one major issue. I'm using esbuild to bundle each worker so I can watch for changes and run 17 workers from a single process. The trouble is esbuild is getting to the './foo.wasm' import first, which is resulting in the CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder (I think that's because the WASM plugin is shoving it into a namespace rather than allowing Miniflare t...

Thanks Adam! I got to try it out this

Thanks Adam! I got to try it out this morning after sending that message and it felt really good. I wrote a thing using Miniflare 3, Prisma and Vitest https://github.com/vladinator1000/prisma-vitest-miniflare

Applying D1 migrations in tests

I don't know how to get this working. ```ts import { Miniflare } from 'miniflare'; import { afterAll, beforeAll, describe } from 'vitest'; import { spawn } from 'child_process';...

Gave this a go here, https://github.com/

Gave this a go here, https://github.com/mrbbot/miniflare-browser-worker-test, currently seeing ProtocolError: Protocol error (Browser.getVersion): Target closed. 😦 I don't have any more time to keep hacking on this today, but I'll leave it here if you wanted to take a look. Let me know if you get anywhere with it! 🙂

hey any update on triggering scheduled

hey, any update on triggering scheduled events?

does anyone know why the jest

does anyone know why the jest environment for miniflare would have changed the functioning of global so that I now have to use globalThis? starting in version 3 I think

Not sure if anyone already suggested

Not sure if anyone already suggested this nor if it's the right place for suggestions, but would be awesome to have a persistent price consumption simulator of all services on miniflare. It could keep track of requests to KV, DO, R2 and all the other services during runtime, compare them to each service pricing and subtracting free-tiers where available. It would be useful to understand if there is a major bug in our code and see an example of bill per month before deploying to production, and (I hope not) waking up in the middle of the night with missing funds on our credit cards 😄 Sounds plausible?...

Unable to get local issuer certificate

hi again 🙂 I'm getting this error workerd/jsg/util.c++:276: error: e = kj/compat/tls.c++:215: failed: TLS peer's certificate is not trusted; reason = unable to get local issuer certificate it only appears when I use service bindings like this: ``` serviceBindings[bindingName] = req => {...

MrBBot Any idea what s going on here

@mrbbot Any idea what's going on here? Will keep digging ```shell Error: write EPIPE at afterWriteDispatched (node:internal/stream_base_commons:160:15)...

Those API options should enable

Those API options should enable workerd's logging. Wrangler actually uses the DevTools inspector protocol for logging instead.

Hey there I found a behavior difference

Hey there, I found a behavior difference between miniflare (via wrangler latest version) and a deployed worker: when using env.R2_BUCKET.put(key, request.body) you will get an error like "Provided readable stream must have a known length (request/response body or readable half of FixedLengthStream)". 1. It's working when deployed on Cloudflare workers 2. It's a request.body...

Any idea for when there will be

Any idea for when there will be analytics engine support with miniflare?

Cache deserialization error

CacheError [ERR_DESERIALIZATION]: Unable to deserialize stored cached data due to missing metadata.
The cached data storage format changed in Miniflare 2. You cannot load cached data created with Miniflare 1 and must delete it.
CacheError [ERR_DESERIALIZATION]: Unable to deserialize stored cached data due to missing metadata.
The cached data storage format changed in Miniflare 2. You cannot load cached data created with Miniflare 1 and must delete it.
...

Is wrangler3 miniflare3 planning to add

Is wrangler3/miniflare3 planning to add support for breakpoints/debugging? 🙏

I was gonna use miniflare jest to test

I was gonna use miniflare-jest to test my worker by making fetch requests to it, as seen in https://miniflare.dev/testing/jest#writing-and-running-tests. I guess we could call theses "integration tests". Can you confirm this is the right way (I guess so, given the doc).

🔌 Multiple Workers · Miniflare

Hi, I have a main worker which has service bindings to two other workers. I would like to create jest integration test for the main worker. I have the directory structure similar to the one in https://miniflare.dev/core/mount and the main worker wrangler.toml has [miniflare.mounts] [build.upload]. I am creating a miniflare instance in the jest test file with a script path
`describe('bluegreen routing', () => { const mf = new Miniflare({ envPath: true,...
Next