Packages

wrangler

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

Your version

4.132.0

15 Sep 2026Where it was published

4.167.0 is the newest release of 4.x.

In short

1 removed6 new9 fixed2 internal

  • Removed

    Remove the gated Web Search binding and Wrangler command

Release note

Minor Changes

  • Categorise the positional path argument to wrangler deploy and wrangler versions upload in command telemetry

    Command telemetry now records a coarse category for the entry-point/assets positional (wrangler deploy <path>) under sanitizedArgs.path, so we can understand whether people pass a file, a directory, or a relational reference such as . or ../example. The possible values are file, directory, current-dir, parent-relative, and not-found, or null when no positional is provided. The raw path is never sent — only the category.

  • Configure application-wide logs for experimental Durable Object-managed Containers

    Set containers.observability.enabled or containers.observability.logs.enabled when using scheduling_policy: "durable_object". Normal deployments create missing applications and update explicitly configured log settings without a Container rollout. Omitted settings preserve the application configuration; root Worker observability is not inherited for this policy.

    Version uploads may initialize missing applications but preserve existing settings. Deploying or rolling back Worker versions also preserves existing application settings, and --containers-rollout=none skips their updates.

  • Support per-image build options for experimental Durable Object-managed Containers

    Set build_context and build_vars alongside dockerfile in a Container's named images entries. Context paths resolve relative to the Wrangler configuration file and default to the Dockerfile's directory. Build variables are passed as Docker build arguments. Entries using the same Dockerfile with different contexts or variables are built separately.

    {
      "containers": [
        {
          "class_name": "Sandbox",
          "scheduling_policy": "durable_object",
          "images": {
            "app": {
              "dockerfile": "./docker/Dockerfile",
              "build_context": ".",
              "build_vars": { "APP_ENV": "production" }
            }
          }
        }
      ]
    }
  • Support AI Search bindings in Worker Previews

    wrangler preview now accepts ai_search and ai_search_namespaces entries in the previews block and includes them in Preview deployment bindings. This lets Workers that use AI Search instance or namespace bindings attach existing resources to Preview deployments, including preview-specific instance or namespace names.

    These bindings are non-inheritable: declare them explicitly under previews. They attach to existing AI Search resources; preview does not provision new isolated instances or namespaces.

  • private beta: Add --secrets-file and --var flags to wrangler preview

    Like wrangler deploy and wrangler versions upload, wrangler preview now accepts a --secrets-file flag pointing to a JSON or .env format file, and --var KEY:VALUE pairs that are injected into the Preview deployment as plain text variables. CLI vars override same-named vars from the previews section of your config file, and secrets from the file take precedence over both:

    wrangler preview --secrets-file .env.preview --var API_URL:https://api.example.com

  • Removed

    Remove the gated Web Search binding and Wrangler command

    The unreleased search binding and its experimental command have been removed from Wrangler, Miniflare, and configuration APIs.

  • Allow experimental Durable Object-managed Containers to link by name through exports

    Containers using scheduling_policy: "durable_object" can now specify name and link from exports.<Class>.container without repeating class_name. Deploy and version upload resolve that link for image preparation, Worker metadata, and Container application creation.

Patch Changes

  • Sync Local Explorer endpoint lists across agent hints

    The Local Explorer endpoint list is now consistent across the three places it appears: the AGENTS.md template in create-cloudflare, the runtime agent hint in wrangler dev, and the Vite plugin agent hint. All three now include the observability/clear endpoint, use the canonical /cdn-cgi/local/explorer path, and have cross-reference comments pointing to each other.

  • Fix per-query overrides for wrangler ai-search search

    --score-threshold, --max-num-results, --filter, and --reranking are now sent using the AI Search request schema, so the service applies them to searches instead of ignoring them.

  • Surface the original error message, name and stack when the dev server reports an internal error

    Previously wrangler dev could exit with an empty ✘ [ERROR] log that gave no indication of what went wrong (e.g. Network connection lost., see #14641). These errors now include their original message, name and stack, so the failure is actually diagnosable.

  • Treat 502, 503, and 504 as gateway errors during asset upload retries

    Pages and Workers asset uploads now retry more patiently when the Cloudflare API responds with a 502, 503 or 504 gateway error, reducing concurrency and waiting longer between attempts instead of failing the deploy quickly.

  • Improve over-limit run_worker_first errors when duplicate rules are present

    The error now reports distinct and duplicate-entry counts and lists duplicated rules, making it clear when removing redundant entries can bring the configuration within the limit.

    Too many `run_worker_first` rules were provided; 105 rules provided (99 distinct, 6 duplicate entries) exceeds max of 100. Note: duplicate entries count towards the route limit. Ensure that no duplicate rules are present in your `run_worker_first` configuration.
    
    The duplicated rules found are:
    - "/rule/0"
    - "/rule/1"
    - "/rule/2"
    - "/rule/3"
    - "/rule/4"
    ...and 1 more duplicated rule.
  • Replace execa with tinyexec for running subprocesses, shrinking the bundled Wrangler output.

  • Preserve service-worker middleware error propagation with spec-compliant event dispatch

    Wrangler's synthetic service-worker events now propagate listener exceptions to middleware without changing the behavior of user-created EventTarget instances.

  • Reduce the size of Wrangler's published package

    Exclude test-only, build-only, and obsolete template files from the npm package while retaining all runtime templates.

  • Restore static asset upload concurrency after gateway errors

    Static asset uploads previously remained at concurrency one for the rest of the deployment after any 524 response, which could make large deployments exceed the upload session lifetime. Successful uploads now restore the session's original concurrency gradually while retaining gateway throttling. Requests that were already in flight when throttling began do not restore capacity, so a burst of stale successes cannot immediately undo backpressure.

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.