npm / miniflare
miniflare
What changed in miniflare 1 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
7 breaking8 security2 deprecations84 new APIs and options3 performance20 behavior and defaults9 tooling65 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initminiflare 4189 changes
Breaking changes 7
In local development, fetch requests using cf.image now transform images via Sharp instead of returning the original bytes; transforms are skipped if Sharp is unavailable.
The public binding type, Wrangler config key, Cloudflare API binding-type string, and Miniflare option key are renamed from web_search/webSearch to websearch; the runtime WebSearch type is unchanged.
Exact configured routes and the configured upstream hostname must match the request hostname exactly; subdomain matching remains limited to wildcard routes.
The spawned workerd subprocess now defaults to TZ=UTC to match production Cloudflare runtime behavior and avoid local development timezone drift.
Flagship bindings always use the remote service in local development; the remote config field now only controls whether a warning is displayed.
Workflow step names in API responses retain their -N suffix so the UI can distinguish duplicate names; the suffix is stripped only visually.
The Flags type was renamed to Flagship to match the upstream rename, updating the import and getFlagshipBinding return type.
Security 8
In local development, steps configured with sensitive: "output" have their output redacted in step logs and step-output responses, while downstream steps still receive the real value.
Dependencies not bundled into published output are pinned to exact versions, preventing fresh installs from resolving an unpinned dependency to a compromised upstream release.
Miniflare validates Host and Origin before rewriting these requests, preventing non-local hostnames from reaching internal development endpoints.
Validates host and origin headers before Miniflare modifies them, preventing same-origin requests from being mistakenly identified and blocked when routes are set.
The bundled devalue dependency was updated to address denial-of-service vulnerabilities in devalue.parse.
The bundled Hono dependency was updated to address security vulnerabilities, including arbitrary file access via serveStatic, JWT algorithm confusion, and XSS through ErrorBoundary.
Bundles the dependency into miniflare to reduce supply chain attack surface and help ensure only trusted code runs on the user's system.
Several utility packages are bundled into published packages instead of being installed separately, reducing the number of external dependencies users need to trust.
Deprecations 2
Pipeline bindings use stream instead of pipeline to match the updated API wire format; pipeline remains accepted but emits a warning.
The export is deprecated; callers should use today’s date directly instead of relying on the workerd-derived compatibility date.
New APIs and options 75
The endpoint accepts ?format=json to return the email handler result as JSON, while requests without it retain the existing text outcome.
Adds a local S3-compatible HTTP API for R2 buckets configured with
s3Credentials, supporting AWS Signature Version 4 authentication and the listed S3 operations.Remote VPC Network and VPC Service bindings now support raw TCP connections through
binding.connect(address)in local development; the feature is experimental and requires no new configuration.Passes space-separated V8 flags to workerd, allowing developers to raise the heap limit and keep long development sessions alive.
A read-only SQL endpoint lets tools query the spans and logs tables.
Set this environment variable to enable local observability while it is off by default during testing.
The worker returned by createTestHarness() can access SQLite-backed Durable Object storage to seed or assert storage state with SQL.
Embedders can pass a shared option to observe revived, source-mapped uncaught Worker errors from requests through the entry socket. It is not invoked by dispatchFetch().
Lets Miniflare callers control the local project temp directory where worker email logs are written; Wrangler and the Vite plugin set it automatically.
Now accepts Durable Object class names as well as binding names.
Adds targeted Durable Object eviction so users can verify how an object recovers after its instance is torn down.
Miniflare exposes an API for listing persisted Durable Object instance IDs by binding name.
Queue producers can send messages to consumers in a separate local dev process. Messages produced before registration or while the consumer is down or reloading are dropped, with a debug-level log.
Worker handles can introspect Workflow bindings by name, enabling tests to disable sleeps, mock step results, and wait for Workflow outcomes; tests can target a known instance by ID or track instances created after introspection starts.
The dev server exposes local R2 bucket objects at this endpoint, supporting GET, HEAD, range requests, conditional headers, and stored HTTP metadata.
Miniflare supports remote-only Agent Memory bindings for storing and retrieving agent conversation state.
The scheduled handler endpoint accepts ?format=json to return the handler result, including whether controller.noRetry() was called.
Miniflare supports the remote-only web_search binding, which exposes search() for web discovery.
Supports workerd autogates via the MINIFLARE_WORKERD_AUTOGATES environment variable.
The hosted images mock now returns usable variant delivery URLs that serve image bytes from the local KV store, helping applications render images during local development.
The send_email MessageBuilder now accepts EmailAddress objects alongside plain strings in to, cc, and bcc arrays, including mixed arrays.
The Miniflare constructor accepts an unsafeRuntimeEnv Record<string, string> option to override the runtime environment, for example to test timezone-dependent behaviour.
A utility is exported to ease handling requests sent to the module fallback service.
Projects developing in Node can access
send_emailbindings fromgetPlatformProxy(), enabling local use of the plain-object MessageBuilder API.Miniflare supports both protocols used by requests to the module fallback service, including the V2 protocol when the
new_module_registrycompatibility flag is set.Local Workflow development can restart an instance from a specified step; earlier steps preserve cached results and replay instantly, while that step and subsequent steps re-execute.
Hyperdrive local development now supports Postgres sslmodes verify-full and verify-ca, and MySQL VERIFY_IDENTITY and VERIFY_CA.
Exports a helper for constructing client-reachable URLs, including correct handling of IPv6 addresses and wildcard listen addresses.
Exposes the configured public URL as a mutable property on the Miniflare instance.
Adds publicUrl so callers can advertise a stable, externally reachable Miniflare URL for Stream preview URLs.
When enabled, preserves the NonRetryableError message and name instead of replacing them with a generic error message.
Wrangler configuration can now define Artifacts bindings, and type generation produces the correct Artifacts type reference.
Configure a Flagship feature flag binding with binding and app_id entries; in local development it returns default values unless remote evaluation is enabled.
A new GET endpoint supports the
metrics()API.The local explorer's OpenAPI spec is now served at this endpoint, allowing independent access to the REST API.
Add this binding configuration to route Worker traffic through a specific Cloudflare Tunnel or the Cloudflare One mesh network.
Set this environment variable to true during local development to enable visible browser rendering for debugging.
The local browser rendering binding now implements the full set of devtools endpoints, matching the remote Browser Rendering API.
Adds a binding to a single AI Search instance in the default namespace. It is remote-only in local dev.
Adds an AI Search namespace binding; namespace is required and auto-provisioned at deploy time if it doesn't exist. It is remote-only in local dev.
The local explorer supports viewing, modifying, and deleting R2 objects, uploading files, and creating directories or prefixes.
Workflow instances support pause in local development; the instance pauses after the current step completes.
Workflow instances support restarting in local development from the beginning.
Workflow instances support resuming in local development from where they left off.
Workflow instances support immediate termination in local development.
Miniflare adds support for the worker connect handler.
Adds Hosted Images CRUD operations to the Images binding; this experimental API currently works only locally.
Adds experimental support for communication from containers to Workers using interceptOutboundHttp; requires the experimental compatibility flag in Wrangler configuration.
Configures a Workflow instance's maximum number of steps, from 1 to 25,000; the default is 10,000, and the limit is enforced in local development via wrangler dev.
Adds Miniflare#purgeCache() to clear the default or a named cache programmatically without restarting the Miniflare instance.
Adds a Local explorer endpoint to introspect SQLite in Durable Objects; it is experimental and gated by X_LOCAL_EXPLORER.
The experimental Local explorer adds endpoints to list Durable Object namespaces and objects.
Set MINIFLARE_CACHE_DIR to choose where Miniflare stores its cf.json cache; otherwise Miniflare detects an existing or suitable cache directory automatically.
The UI and list keys API now let you search KV keys by prefix; the feature is experimental.
When enabled, Miniflare serves the bundled local explorer UI at this path. The feature is experimental and a work in progress.
Controls whether Miniflare fetches data for Request.cf caching; setting it to false disables fetching and uses fallback data, without creating node_modules/.mf/cf.json.
Sets a custom location for caching the cf.json file instead of the default node_modules/.mf/cf.json.
Adds an API that returns a list of D1 databases for the experimental/WIP local resource explorer.
Adds an API that returns query result rows as arrays rather than objects for the experimental/WIP local resource explorer.
The version metadata binding in local development now includes a timestamp field alongside id and tag, enabling local testing of version-aware logic.
An optional zone option specifies the zone value for the CF-Worker header; otherwise it defaults to
${worker-name}.example.com.Adds an API to delete a key in the experimental/WIP local resource explorer.
Adds an API to list namespaces for the experimental/WIP local resource explorer.
Adds an API to list keys for a namespace in the experimental/WIP local resource explorer.
Adds an API to get a value in the experimental/WIP local resource explorer.
Adds an API to bulk get values in the experimental/WIP local resource explorer.
Adds an API to write a value in the experimental/WIP local resource explorer.
Adds a configuration option to customise the IP address that the inspector server listens on, instead of being limited to 127.0.0.1.
Adds a CLI flag to customise the IP address that the inspector server listens on, instead of being limited to 127.0.0.1.
Adds a no-op local explorer worker gated by the experimental flag.
Miniflare local mode now supports the Email Sending API’s simplified MessageBuilder interface alongside EmailMessage; email content is stored in temporary files for inspection, with file paths logged when emails are sent.
Miniflare adds the MF-Original-Hostname request header when using the upstream option, preserving the incoming hostname after the Host header is rewritten.
Adds an experimental local-development handler that receives streamed tail events from a Worker as they occur, rather than batched events after processing finishes.
Adds an option that lets consumers of workerd structured logs print them without additional boilerplate.
Adds support for media bindings.
Performance 3
Asset requests avoid an unnecessary internal dispatch hop, reducing latency.
Streamlined router request handling reduces latency for Workers with assets.
Improves local Hyperdrive binding latency on Windows.
Behavior and default changes 20
When enabled, local observability captures Workflows invocations so workflow runs appear in the Local Explorer's Observability view with traces, spans, and logs.
The updated sharp no longer requires explicit build approval in package managers that block dependency build scripts by default.
In local dev, retries.delay can be a function that computes a delay for each failed attempt; its result is fed into the configured backoff.
Workflow bindings with a scriptName referring to a worker registered in another Miniflare instance via unsafeDevRegistryPath are rerouted through the dev-registry-proxy worker.
Miniflare can parse scripts using the using and await using keywords.
When set, CF_TRACE_ID is forwarded as a cf-trace-id header on outgoing remote binding proxy requests, making traces easier to correlate during local development.
If the configured assets directory does not exist, Miniflare starts asset services with zero assets and reloads when the directory is created and
setOptions()is called.When SSL is disabled, Miniflare connects directly to the database instead of creating a local TCP proxy, avoiding connection failures caused by firewall rules or proxy port binding issues.
Videos uploaded in local mode are served at /cdn-cgi/mf/stream/<video-id>/watch, and StreamVideo.preview is directly fetchable during development.
The workerd debug port powers cross-process service bindings, Durable Objects, and tail workers via the dev registry, enabling Durable Object RPC and improving stability.
The
/messageand/batchendpoints return queue metrics in a JSON response body instead of an empty response.Stream data is persisted across restarts by default; set
streamPersist: falsein Miniflare options to disable persistence.Undici Pool request timeouts are disabled for local development, preventing long-running requests from being killed after five minutes.
The experimental local explorer is enabled by default and can be disabled by setting X_LOCAL_EXPLORER=false.
The allowlists now accept connections from the new workers.dev domain patterns while retaining legacy pages.dev patterns for backward compatibility.
Container local development now prepares the egress interceptor sidecar image by default, making container-to-Worker interception available without the experimental compatibility flag.
The local explorer can view and edit resources bound to workers in other Miniflare instances when multiple processes are running.
The maximum allowed delivery and retry delays for Queues is now 24 hours.
Outgoing fetch requests in local development now include the CF-Worker header to match production behavior.
Miniflare sets the minimum KV Cache TTL to 30 seconds.
Tooling 9
Local Worker invocations can be traced across worker and Durable Object boundaries, capturing spans, logs, and console output.
A new Observability tab provides Traces and Events views for exploring local invocation data.
With remote bindings, warns when Cloudflare Access blocks a request and replaces the HTML block page with plain-text authentication guidance.
The explorer lists Durable Object instances by name where possible, making instances easier to identify.
The local explorer now includes a Workflows dashboard for viewing and managing workflow instances during local development.
Miniflare and
wrangler devsupport Stream bindings locally, including the listed video, caption, download, and watermark operations. Direct uploads and File-based caption or watermark uploads are not supported.The local Chrome version used by the Browser Rendering binding was upgraded to 126.0.6478.182.
The local explorer provides a worker selector so developers can inspect each worker’s bindings independently; the selection is reflected in the URL as a ?worker= search param.
Hyperdrive bindings in wrangler dev can connect to external databases that require TLS.
Fixes and other changes 65
Local Images binding transforms now respect the fit, gravity, and background options, matching production behavior instead of always letterboxing with black bars.
The idle keep-alive timeout is disabled to prevent pooled workerd connections from failing with
Network connection lostduring local development.Preserves metadata when stored KV values are falsy, such as an empty string or
"0"; missing keys still return null metadata.On Windows, hides the workerd console window when the parent process has no console, preventing a visible, focus-stealing window for background or detached parents.
AVIF inputs are now correctly reported as image/avif rather than as an unsupported or unknown type.
The error now reports the enforced 288000-byte maximum instead of the incorrect 256000-byte limit.
The Cloudflare Vite plugin restarts the Vite development server after workerd recovers, recreating its environments, hot channels, and module runners.
Miniflare restarts workerd after post-startup crashes so local development can serve subsequent requests; startup crashes remain fatal.
For HEAD requests, dispatchFetch() reports the Worker’s original error and source-mapped stack instead of a misleading JSON parse error.
Cleanup removes only the current instance's session directory and leaves the shared parent intact, avoiding startup failures when concurrent local runtimes use the same project.
Graceful Chrome shutdown is bounded and the browser process tree is forcefully terminated when needed, preventing disposal from waiting indefinitely.
Uncaught Worker errors with stack-frame file URLs that cannot be converted to local paths no longer prevent error reporting; source mapping degrades to an unmapped stack and the pretty page falls back to a plain stack response.
Local rate limit counters are keyed by namespace_id, so bindings sharing a namespace share a limit and distinct namespaces stay isolated. Rate limit bindings also work in multiworker wrangler dev sessions.
reset() from cloudflare:test now resets ratelimit binding state between tests, preventing stale in-memory bucket counts from affecting later tests in the same file.
The local R2 public bucket endpoint now matches r2.dev for write-method rejection, range handling, HEAD responses, percent-decoded keys, default content types, and cancellation of unread bodies.
Local Workflows now copy a Uint8Array's bytes to a tight buffer before persistence, avoiding SQLITE_TOOBIG errors for views backed by larger buffers.
Calls such as getKVNamespace() or getR2Bucket() with a binding name not configured for that resource type now report the expected binding type in the error message.
Scheduled handlers can now be triggered locally on Workers that have assets.
Miniflare detects workerd termination during startup instead of hanging indefinitely, and throws ERR_RUNTIME_FAILURE with the runtime's stderr output.
The inspector now uses 127.0.0.1 instead of localhost, avoiding bind failures when localhost resolves to IPv6 while IPv6 is disabled.
URLs displayed in CLI output no longer include trailing sentence-ending periods, preventing some terminal emulators from including the period when opening the link.
Browser launch waits up to five minutes for Chrome to print its DevTools WebSocket URL, preventing indefinite hangs.
Fixes crashes under Yarn PnP when a worker emits a structured log or the inspector forwards a stack trace.
Workers configured with a custom outbound service can now open TCP connections with cloudflare:sockets; previously, TCP requests could throw an error.
Upstream failures now surface the HTTP status and response body; a SyntaxError is chained via cause when a 2xx response contains invalid JSON.
When browser installation encounters a specific corrupted-cache error, Miniflare removes the cache directory and retries installation once.
Miniflare deduplicates compatibility flags for the internal Workflow engine service, preventing
wrangler devfrom failing when the user's Worker enablesexperimental.Addresses in "Name" <address> format are now correctly parsed when checking allowed_destination_addresses and allowed_sender_addresses restrictions.
Miniflare waits until Chrome accepts connections before declaring the browser ready and retries transient connection failures, preventing Browser Run errors on Windows.
Fixes local explorer startup in Yarn Plug'n'Play projects by copying UI assets to a real temporary directory before registering the workerd disk service.
Serialization normalizes subclass constructor names to the nearest standard typed array parent, preventing proxy serialization failures for values such as Node.js
Buffer.Multiple workers can now run with multiple browser bindings in Miniflare without crashing.
Service binding and tail consumer props are now forwarded correctly across separate local development instances.
When static_routing is configured without user_worker rules, the router-worker now falls back to an empty list instead of failing the request.
Windows uses polling for the filesystem-based dev registry so cross-process worker registrations are observed reliably, avoiding delays that could time out service-binding calls.
Caption uploads via ReadableStream are supported in local mode instead of throwing a not-supported error.
The build inlines sourcesContent and patches null entries in bundled sourcemaps, preventing warnings when tools validate them at runtime.
User-facing strings, error messages, and CLI output now use Browser Run instead of Browser Rendering.
In local mode, the send_email binding's send() now returns { messageId: string } instead of undefined, matching the production SendEmail result shape.
When localhost is configured, internal communication between Node.js and workerd uses 127.0.0.1, avoiding connection-refused errors and CPU spins while preserving the user-facing URL.
Disposal now closes open handles so the Node.js event loop can exit cleanly instead of leaving processes, particularly tests, hanging.
Preview tokens are proactively refreshed at 50 minutes, error code 1031 responses trigger refresh, and credentials are resolved when a remote proxy session starts.
POST or PUT requests with non-2xx responses no longer throw a “fetch failed” TypeError on stream-backed request bodies.
Fixes handling of resources bound to multiple workers in the local explorer.
The local Images binding mock now returns a chainable handle with details(), bytes(), update(), and delete() methods, aligning with the updated workerd API.
Fixes a TLS configuration bug for Hyperdrive bindings in local development.
Miniflare now parses source phase imports when analyzing module dependencies, fixing ERR_MODULE_PARSE errors for Workers using WebAssembly source phase imports in local development.
Temporary-directory cleanup during dispose() is now best-effort on Windows, preventing noisy EBUSY errors from propagating when workerd releases file handles late.
Glob patterns now match only paths that literally end with the pattern, preventing rules such as
**/*.wasmfrom matching files likefoo.wasm.js.The local Browser Rendering binding now reciprocates browser websocket close events.
Mixed string and object entries in d1Databases configuration are now accepted and normalised correctly.
Mixed string and object entries in kvNamespaces configuration are now accepted and normalised correctly.
Mixed string and object entries in pipelines configuration are now accepted and normalised correctly.
Mixed string and object entries in r2Buckets configuration are now accepted and normalised correctly.
The local explorer filters metadata.sqlite from Durable Object instance listings to avoid inflated counts and pagination problems.
Explorer route matching now accepts only the exact path and its sub-paths; similar-prefix paths fall through to the user worker.
AI Search bindings now work correctly in local development with wrangler dev instead of failing with a non-serializable RPC stub error.
Disposes stdio streams before killing a restarted workerd process, preventing potential EBADF errors during spawn on some systems.
Scheduled trigger warnings now appear after the proxy server is ready, so they use the actual public URL and port instead of showing an undefined port.
Miniflare now prevents connection reuse to eliminate intermittent “Fetch failed” errors caused by race conditions when idle connections close.
Durable Object RPC calls from Node.js now yield control to the event loop, allowing concurrent operations, Promise.race(), and timeouts to work correctly.
Reading and writing dev registry files is more resilient.
Free-port selection is more resilient when many Miniflare instances run in parallel, reducing failures if a port becomes unavailable between checking and use.
Disabling Node.js HTTP timeouts prevents long-lived WebSocket connections through the dev registry proxy from failing with ERR_HTTP_REQUEST_TIMEOUT.
Void-returning RPC methods on workflow bindings no longer receive unnecessary extra disposal calls, reducing unrelated internal errors visible to customers.
miniflare 19 changes
New APIs and options 9
Deletes specified keys in a namespace using a JSON file.
Uploads key-value pairs from a JSON file, supporting expiration fields and base64-decoded values.
Removes a single key-value pair from a namespace.
Reads a single value by key from a namespace, with optional environment, preview, or namespace ID selection.
Lists keys in a namespace and can filter the results by prefix.
Writes a key-value pair to a namespace, with optional expiration, environment, preview selection, or file-based input.
Creates a Workers KV namespace and prints a configuration block to add to the Wrangler file; supports environment-specific and preview namespaces.
Deletes a KV namespace by binding or namespace ID, with optional environment and preview selection.
Lists all KV namespaces associated with an account ID.