Is there anyway to view KV records in a UI like the cloudflare dashboard?
Is there anyway to view KV records in a UI like the cloudflare dashboard?
vitest-environment-miniflare setup until v3 supports it in some way - unit tests aren't currently possible - you can use unstable_dev from wrangler if you want to do e2eworkerd is released.
things will be a lot smoother
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)".sourcemap support is on the docket for the API? That's pretty much the only bit of moving to v3 that's got me bummed, the logging leaves a lot to be desiredworkerd, you'll need to wrap your worker with something that returns un-source-mapped stack traces as JSON using the MF-Experimental-Error-Stack header: https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/templates/middleware/middleware-miniflare3-json-error.ts. Wrangler will do this automatically.workerd at some point. wrangler.toml parsing and passing bindings in the config- it's less "magic", but for me it seems easier to debugunstable_dev() API (https://developers.cloudflare.com/workers/wrangler/api/) at some point soon, which will allow you to use your wrangler.toml file, but customise as required in JavaScript too. wrangler dev, right? If there is I can save myself the pain of manually putting together the esbuild watch -> MF reload script.wrangler dev session in each worker's directory, they should auto-magically connect. We're considering eventually moving to a Docker Compose style solution, where running wrangler dev automatically starts up all required services though.
toml (I had just added the placement table and had services below it, so services was interpreted as a key on placement)console.logs appear when running via the API, but they are appearing via wrangler dev. I have log: new Log(LogLevel.VERBOSE), in my options and verbose: true,, is there something else I'm missing?workerd's logging. Wrangler actually uses the DevTools inspector protocol for logging instead.workers array but the contents of /scripts/ can change during dev, and this way the latest script is used for each request. is this an ok approach?import { D1Database, D1DatabaseAPI } from "@miniflare/d1";
import { drizzle } from "drizzle-orm/d1";
const d1 = new D1Database(new D1DatabaseAPI(sqliteDb));
const db = drizzle(d1); // now I can can write unit tests for drizzle/usr/lib/node_modules/wrangler/node_modules/@cloudflare/workerd-linux-64/bin/workerd: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory
✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.workers/scripts/app.use('/:name/*', async (req, res) => {
const mf = new Miniflare({
scriptPath: `./scripts/${req.params.name}/index.js`,
bindings: process.env,
})
const url = `http://localhost:8787${req.originalUrl}`
const queryRes = await mf.dispatchFetch(url, {
method: req.method,
headers: req.headers,
body: req.body,
})
res.send(await queryRes.text())
await mf.dispose()
})