miniflare
4.20260730.0 · 30 Jul 2026MIT57.5M / weekRepositoryHomepagenpmAtom feed
4.20260730.0 is the newest release of 4.x.
In short
2 new5 fixed1 internal
Release note
Minor Changes
Add a
handleUncaughtErrorshared option that receives uncaught Worker exceptionsThe runtime catches handler exceptions to build the 500 response, so they never reach the inspector — the one place an uncaught exception exists as a structured value in Node is the pretty-error path, where the error report from the Worker is revived into a source-mapped
Error. Embedders can now passhandleUncaughtError: (error: Error) => voidto observe that revived error programmatically; logging behavior is unchanged.The hook fires only where the pretty-error path does: requests reaching the Worker through the entry socket (a browser or another HTTP client against the dev server).
dispatchFetch()is unaffected — it always setsMF-Disable-Pretty-Error, and the entry worker then propagates the exception by rejecting the returned promise instead, sodispatchFetch()callers already receive the error directly and the hook is not invoked.Add Durable Object storage access to
createTestHarness()You can now execute SQL against a SQLite-backed Durable Object to seed or assert the storage state.
const server = createTestHarness({ workers: [{ configPath: "./wrangler.json" }], }); await server.listen(); const worker = server.getWorker(); const storage = await worker.getDurableObjectStorage("COUNTER", { name: "user-123", }); await worker.fetch("/counter/user-123"); const rows = await storage.exec( "SELECT value FROM counters WHERE id = ?", "user-123" ); expect(rows).toEqual([{ value: 1 }]);
Patch Changes
Improve asset serving performance by removing an unnecessary internal dispatch hop
Asset requests and RPC calls now avoid an extra internal forwarding layer, reducing latency. The forwarding infrastructure is preserved for future use by cohort-based deployments.
Keep reporting uncaught Worker errors when a stack frame's file URL has no local path
fileURLToPaththrows onfile://URLs that cannot be represented as a local path (a non-local host; on Windows, any drive-less path — which is everyfile:///...URL reported by a POSIX-built bundle). Both the source-mapping machinery andyouch's error-page frame parsing convert stack-frame specifiers this way, so one such frame previously failed the whole pretty-error request: the error page was replaced by a raw Node stack, the error was not logged, andhandleUncaughtErrordid not fire. Source mapping now degrades to the unmapped stack and the pretty page falls back to a plain stack response instead.Improve routing performance for Workers with assets
Reduce request handling latency by streamlining the router Worker's request path. The loopback infrastructure remains available for future use.
Prevent local Browser Rendering teardown from hanging when Chrome does not exit
Miniflare now bounds graceful Chrome shutdown and forcefully terminates the browser process tree when needed, preventing disposal from waiting indefinitely.
Prevent concurrent Miniflare instances from deleting each other's temporary email sessions
Email session cleanup now removes only the current instance's session directory and leaves the shared parent intact, avoiding startup failures when multiple local runtimes use the same project.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.