Packages

wrangler

4.164.0 · 17 Nov 2026MIT OR Apache-2.049.3M / weekRepositoryHomepagenpmAtom feed

Your version

4.148.0

6 Oct 2026Where it was published

4.167.0 is the newest release of 4.x.

In short

5 new5 fixed2 internal

Release note

Minor Changes

  • Add --source-namespace and --source-repo-name to wrangler queues subscription create for the artifacts.repo source

    The Event Subscriptions API requires source.namespace and source.repo_name for artifacts.repo subscriptions, but Wrangler had no way to pass them, so --source artifacts.repo always failed with a validation error. Both flags are now required for this source, and wrangler queues subscription get shows the subscription's resource as <namespace>/<repo-name>.

  • Add assets.base_path support to Workers Assets

    Serve an asset directory from a public URL prefix without changing its on-disk layout:

    {
      "assets": {
        "directory": "./public",
        "base_path": "/docs"
      }
    }

    Wrangler, preview, Miniflare, and generated build configuration preserve the explicitly selected value, while the Asset Worker normalizes it and strips the prefix only for asset lookup. Requests passed to a user Worker, request-facing headers, and redirects retain the public path. Relative pathname inputs are interpreted as root-relative prefixes, URL-shaped values are rejected, and omitting the option preserves existing root-path behavior.

    Authored _headers and _redirects rules continue to match full public paths. In particular, both the source and destination of an authored 200 asset rewrite must include the configured public prefix; Asset Worker-generated redirects are prefixed automatically.

  • Add a --experimental-mode instant option to wrangler kv namespace create

    This lets entitled accounts create Workers KV Instant namespaces while the feature is in private beta.

  • Add email-protected Quick Tunnels to wrangler dev

    Pass one or more --tunnel-allowed-mail flags to require email authentication when exposing a local development server through a Quick Tunnel. Each value can be an exact email address or a domain pattern.

  • Support deleting secrets with wrangler versions secret bulk

    Set a secret's value to null in JSON input to remove it from the new Worker version. Bulk output now distinguishes between created and deleted secrets, so retrying wrangler secret bulk with wrangler versions secret bulk preserves requested deletions. Deploy the new version with wrangler versions deploy to apply the changes to production traffic.

Patch Changes

  • Improve guidance for conflicting Wrangler configuration files

    When user and generated deploy configurations are found under different base paths, Wrangler now identifies the expected deploy configuration location, suggests how to resolve the conflict, and links to the relevant documentation.

  • Include default module rules in generated Worker types

    wrangler types now declares the built-in Text, Data, and WebAssembly module patterns even when they are not repeated in the Wrangler configuration, keeping generated types aligned with deployment behavior.

    Service-worker declaration files are emitted as global scripts so that the generated wildcard module types are visible to imports.

    Directory-specific rules retain their scope when TypeScript can represent it; ambiguous relative imports use a union of the possible deployed module types.

    When generating combined types for named environments, each environment's effective rules are resolved independently and differing import types are represented as unions.

  • Fix r2 object put and r2 bulk put storing a different key in local mode

    Keys that are not URL-safe were mangled on the way into local storage.

    • A key with a space or a non-ASCII character was stored under its percent-encoded name, so a later r2 object get for that key reported that the key does not exist.

    • Two keys that differ only after a # collapsed into a single object, and the second upload replaced the first.

    • A key with a % that is not a valid escape failed outright with "Invalid URL string.", and one with a valid escape, such as %41.txt, was stored as A.txt.

    Spaces, non-ASCII characters, # and % now survive the trip into local storage. Objects already in local state are left where they are.

  • Show a useful error when wrangler secret bulk hits an undeployed latest version

    wrangler secret put already explained this case (API error 10215). secret bulk just dumped the raw API response, which for 10214 talks about logpush and tail_consumers even though you were only uploading secrets.

    Both commands now point at wrangler versions secret … instead.

  • Print temporary account notices to stderr

    The terms notice, the proof-of-work message, and the "Temporary account ready" claim details printed by --temporary now go to stderr instead of stdout. Previously they corrupted command output on stdout, such as the JSON from wrangler kv namespace list --temporary or the raw value from wrangler kv key get --temporary. Commands that lower the log level for --json, such as wrangler d1 execute --json --temporary, also hid the claim URL; it is now shown unless logging is disabled with WRANGLER_LOG=none.

    Scripts that read the claim URL from stdout should read stderr instead.

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.