Files
wehub-resource-sync 70bf21e064
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:30:11 +08:00

1.4 MiB
Raw Permalink Blame History

wrangler

4.110.0

Minor Changes

  • #14591 0283a1f Thanks @dario-piotrowicz! - Send npm package dependency metadata with worker uploads

    Wrangler now collects npm package dependency information from the project's package.json at deploy and version upload time, and includes it in the upload metadata sent to the Cloudflare API. This enables dependency analytics and future features like vulnerability alerting.

    The collected data includes the package name, the version constraint from package.json, and the exact installed version from node_modules. Both dependencies and devDependencies are included, while workspace packages, local packages, and unresolvable packages are excluded. The list is capped at 200 entries per upload.

    To opt out, set dependencies_instrumentation.enabled to false in your Wrangler configuration file:

    {
      "dependencies_instrumentation": {
        "enabled": false
      }
    }
    
  • #14535 1b965c5 Thanks @Naapperas! - Support dynamic retry delays for Workflow steps in local dev

    A step's retries.delay can now be a function that computes the delay per failed attempt, in addition to a static duration. The function receives { ctx, error } and returns a delay (a number of milliseconds or a duration string like "30 seconds"), and its result is fed into the configured backoff.

    await step.do(
      "call flaky API",
      {
        retries: {
          limit: 5,
          backoff: "constant",
          delay: ({ ctx }) => ctx.attempt * 1000,
        },
      },
      async () => {
        /* ... */
      }
    );
    

    The function is invoked once per failed attempt with a 5 second timeout. If it throws, times out, or returns an invalid value, the step fails without further retries.

Patch Changes

  • #14589 7b28392 Thanks @jamesopstad! - Fix runtime type caching when wrangler dev auto-regenerates types

    When dev.generate_types (or wrangler dev --types) regenerated an out-of-date worker-configuration.d.ts, the written file omitted the // Begin runtime types marker (and the /* eslint-disable */ header) that wrangler types writes. As a result, later runs could not detect the cached runtime types and always regenerated them. The auto-regenerated file now matches wrangler types output, restoring the cache.

  • Updated dependencies [1b965c5]:

4.109.0

Minor Changes

  • #14489 e3f0cd6 Thanks @edmundhung! - Add listDurableObjectIds() to createTestHarness Worker handles

    Tests using createTestHarness can now list persisted Durable Object instance IDs for a Durable Object binding. This helps integration tests discover objects created by app behavior without adding test-only endpoints.

  • #14465 2fedb1f Thanks @vaishnav-mk! - Add rollback support when terminating Workflow instances

    WorkflowInstance.terminate({ rollback: true }) now runs registered rollback handlers before marking a local Workflow instance as terminated. Wrangler also supports this via wrangler workflows instances terminate --rollback, including local mode.

    The rollback option is only sent for terminate operations and is rejected by the Local Explorer API for pause, resume, and restart actions.

  • #14511 17d2fc1 Thanks @juleslemee! - Add wrangler turnstile widget commands for managing Turnstile widgets

    You can now create, list, inspect, update, and delete Turnstile widgets from the CLI:

    wrangler turnstile widget create <name> --domain example.com --mode managed
    wrangler turnstile widget list
    wrangler turnstile widget get <sitekey>
    wrangler turnstile widget update <sitekey> --name "Renamed"
    wrangler turnstile widget delete <sitekey>
    

    All five subcommands accept --json for machine-readable output (get prints a formatted view by default; the rest print a short human summary). --domain accepts comma-separated values, e.g. --domain a.com,b.com. delete --json requires --skip-confirmation/-y to keep output pipeable.

    create prints the sitekey, the secret, and the canonical challenges.cloudflare.com/turnstile/v0/siteverify endpoint for backend verification. The hint is backend-agnostic; it doesn't assume Workers. The secret is redacted from list and update output but remains available via get for retrieval later. delete prompts for confirmation; pass --skip-confirmation/-y to bypass.

    The OAuth flow now requests the challenge-widgets.write scope (the existing Bach-derived scope for Turnstile widget CRUD). Existing OAuth sessions need to run wrangler login again to pick it up. API token users need a token with the Account.Turnstile:Edit permission.

Patch Changes

  • #14596 8511ddf Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260706.1 1.20260708.1
    @cloudflare/workers-types ^5.20260706.1 ^5.20260708.1
  • #14604 9f74a5f Thanks @vaishnav-mk! - Improve the deploy error for cron-triggered Workflows on free plans

    Wrangler now explains that Workflow schedules require a paid Workers plan instead of showing only the generic Workflows API request failure.

  • #14616 c782e2a Thanks @penalosa! - Fix wrangler deploy aborting in CI for autoconfigured projects

    A recent change guarded non-interactive deploys against overwriting a same-named Worker whenever there was no config file naming it. This was too broad: a plain wrangler deploy run in CI without a config file (for example an autoconfigured project whose generated config PR has not been merged) would fail with "A Worker named ... already exists in your account", even though re-deploying to that Worker is the intended behaviour.

    The guard is now limited to the Pages-to-Workers delegation, where the target name is a Pages project name that must not clobber an unrelated Worker. Plain deploys once again deploy normally.

  • Updated dependencies [e3f0cd6, 8511ddf, 2fedb1f]:

4.108.0

Minor Changes

  • #14312 54f74b8 Thanks @MattieTK! - Delegate agent-driven static Pages deploys to Workers

    When wrangler pages deploy or wrangler pages project create is run by an AI coding agent against a brand-new, purely static project, Wrangler now delegates it to Workers static assets (using autoconfig) instead of Cloudflare Pages. Accounts that already have Cloudflare Pages projects, non-agent (human) sessions, and projects using Pages features that can't be carried across to Workers (Pages Functions, a _worker.js, or a _routes.json file) are unaffected and continue to use Pages. Passing --force to either command opts out of the delegation and deploys to Pages directly. Once the Workers deploy starts it is not silently swapped back to Pages: if it fails, the error is surfaced and the --force opt-out is suggested.

Patch Changes

  • #14567 0852346 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler", "create-cloudflare"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260702.1 1.20260706.1
    @cloudflare/workers-types 4.20260702.1 5.20260706.1
  • #14312 54f74b8 Thanks @MattieTK! - Avoid silently overwriting an existing Worker during non-interactive deploys that cannot prove they own the name

    A non-interactive deploy (an agent, CI, or the agent-delegated wrangler pages deploy) has no way to prompt before overwriting a Worker, so it now stops if the target name is already taken and this run cannot show it owns that Worker. This applies when there is no Wrangler configuration file naming the Worker and either the name was generated automatically or the deploy is the Pages-to-Workers delegation (where the name carried across is a Pages project name, not proof of Worker ownership). The check reuses the service metadata the deploy already fetches, so it adds no extra API calls.

    Deploys are unaffected when a configuration file names the Worker (so repeat deployments continue to update it), and interactive deploys keep their existing confirmation flow. To update an existing Worker in one of the guarded cases, add a Wrangler configuration file naming it, or deploy under a different name.

  • Updated dependencies [0852346]:

4.107.1

Patch Changes

  • #14514 d88555e Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260701.1 1.20260702.1
  • #14564 5fd8bee Thanks @jibin7jose! - Fix an issue where wrangler dev would not override config vars with values from .dev.vars during local development when the secrets field was defined in the configuration file.

  • #14332 5d9990e Thanks @Divkix! - Fix misleading error guidance when deploying a new Worker with secrets.required

    When a Worker declares secrets.required and has never been deployed before, the previous error message suggested running wrangler secret put <NAME>, which doesn't work because the Worker doesn't exist yet.

    The one path that does work — wrangler deploy --secrets-file <path> — was not mentioned anywhere in the error output.

    The pre-deploy error now explains that wrangler secret put cannot be used for a new Worker, and directs users to the --secrets-file flag instead. The post-deploy error for existing Workers now also mentions --secrets-file alongside wrangler secret put.

  • #14507 bf49a41 Thanks @joey727! - Fix a potential crash when displaying certain CLI output

    Previously, some CLI output with no content lines could cause a crash. This is now handled correctly.

  • #14492 1ac96a1 Thanks @penalosa! - Replace the CommonJS xdg-app-paths dependency with a vendored pure-ESM implementation

    xdg-app-paths (and its xdg-portable/os-paths dependencies) are CommonJS only, which caused "Dynamic require of 'path' is not supported" errors when the surrounding code was bundled to ESM. The global config/cache directory resolution is now provided by a small, dependency-free pure-ESM module in @cloudflare/workers-utils that reproduces the previous path resolution exactly (verified against the real package in unit tests), so existing config and credential locations are unchanged. This also drops the transitive fsevents optional dependency that xdg-app-paths pulled in.

    Miniflare and create-cloudflare now consume the shared helpers from @cloudflare/workers-utils instead of maintaining their own copies, importing node-only leaf entry points (@cloudflare/workers-utils/fs-helpers, @cloudflare/workers-utils/global-wrangler-config-path) where ESM bundling is required.

  • #14572 f416dd9 Thanks @petebacondarwin! - Key local rate limit counters by namespace_id instead of binding name

    wrangler dev and Miniflare previously tracked each rate limit binding's counter by its binding name, so two bindings that referenced the same namespace_id were treated as separate limiters. Counters are now keyed by namespace_id, matching production: bindings that share a namespace_id share a limit, while distinct namespaces stay isolated. This also re-enables rate limit bindings in multiworker wrangler dev sessions, where they were previously stripped from secondary Workers to avoid a startup crash.

  • #14570 1ca8d8f Thanks @penalosa! - Upgrade signal-exit from v3 to v4

    The bundled signal-exit dependency was CJS-only. Upgrading to v4 (which ships a dual ESM/CJS build) unblocks ESM output. Exit-cleanup behaviour is unchanged, though v4 no longer registers handlers for a few signals that are no longer supported by the OS (SIGUNUSED on Linux; SIGABRT/SIGALRM on Windows).

  • #14561 b973ed3 Thanks @martijnwalraven! - Emit an error event for watch-mode rebuild failures in unstable_startWorker

    Initial build failures already dispatch an error event (surfaced as buildFailed on the DevEnv bus), but watch-mode rebuild failures were only logged from inside the esbuild plugin, so programmatic consumers had no way to observe them while dev kept serving the previous bundle. Rebuild failures now route through the same error path as initial-build failures: terminal output is unchanged and buildFailed fires symmetrically.

  • Updated dependencies [e7e5780, d88555e, 1ac96a1, f416dd9, 16fbf81]:

4.107.0

Minor Changes

  • #14474 aa5d580 Thanks @WillTaylorDev! - Add cache options for WorkerEntrypoint exports

    You can now set cache options on WorkerEntrypoint exports and configure cross-version cache behavior globally:

    // wrangler.json
    {
      "cache": { "enabled": true, "cross_version_cache": true },
      "exports": {
        "default": {
          "type": "worker",
          "cache": { "enabled": false }
        },
        "Admin": {
          "type": "worker",
          "cache": { "enabled": true }
        }
      }
    }
    

    Wrangler sends the exports config to the deploy and version upload APIs alongside the global cache.enabled and cache.cross_version_cache settings. The platform resolves those global settings plus cache overrides on exports and validates which entrypoint names are cacheable.

  • #14382 fd92d56 Thanks @petebacondarwin! - Add support for declarative Durable Object exports

    wrangler deploy now accepts an exports map in wrangler.json as a declarative alternative to the legacy migrations array.

    Each entry in exports is keyed by Durable Object class name. type carries the export kind (currently always "durable-object"); the state field carries the lifecycle and defaults to "created" (live) when omitted:

    {
      "exports": {
        // Provision a new Durable Object class (`MyDO`)
        "MyDO": { "type": "durable-object", "storage": "sqlite" },
        // Delete Durable Object class (`OldGone`)
        "OldGone": { "type": "durable-object", "state": "deleted" },
        // Rename a Durable Object class (from `OldName` to `NewName`)
        "OldName": {
          "type": "durable-object",
          "state": "renamed",
          "renamed_to": "NewName"
        },
        "NewName": { "type": "durable-object", "storage": "sqlite" },
        // Transfer a Durable Object (`Outgoing`) to a new Worker (`target-worker`)
        "Outgoing": {
          "type": "durable-object",
          "state": "transferred",
          "transferred_to": "target-worker"
        },
        // Prepare to receive the transfer of a Durable Object (`Incoming`) from another Worker (`source-worker`)
        "Incoming": {
          "type": "durable-object",
          "state": "expecting-transfer",
          "storage": "sqlite",
          "transfer_from": "source-worker"
        }
      }
    }
    

    When a Worker declares Durable Object class bindings but no lifecycle for them (neither a migrations array nor an exports map), wrangler warns and now suggests a declarative exports entry for each class (previously it suggested a legacy migrations block).

    The deployment response now surfaces the server's reconciliation result — created namespaces, applied tombstones, structured per-scenario info entries, and a removable_entries hint for stale tombstones that are safe to delete from the config. Blocking errors return the structured per-class detail with scenario tags, suggested remediation, and any referencing-script context.

    wrangler versions upload also forwards exports. Declarative exports lifecycle changes are reconciled when the version is deployed (wrangler versions deploy or wrangler deploy), so a versions upload payload can declare new classes in exports without immediately provisioning them. An actor binding (durable_objects.bindings) to a class declared only in exports on the same versions upload is rejected with a clear error (code 100406) — the binding cannot be resolved until the namespace is provisioned. Either stage the new class via ctx.exports.X (no binding required) on versions upload and add the binding at deploy time, or use wrangler deploy to provision and bind in one step (the same constraint applies to the migrations flow).

    Multi-version deploys (wrangler versions deploy A@50% B@50%) where the selected versions disagree on declarative exports are rejected server-side with a clear message: deploy the version that changes exports at 100% first, then run the percentage-split deploy. This prevents traffic on one branch routing to code that references unprovisioned or just-deleted DO namespaces. Single-version (100%) deploys are unaffected.

    Local development (wrangler dev, vite dev and unstable_startWorker) reads Durable Object SQLite storage settings from the new exports field, so applications using the declarative flow get correct local-dev storage without needing to also declare a migrations block.

    @cloudflare/vitest-pool-workers also picks up Durable Object configuration from exports, so tests against an exports-only Worker run with the correct local SQLite storage and can reach unbound Durable Object classes via ctx.exports.X.

    wrangler types is also aware of exports. Live entries (including expecting-transfer, the receiving side of a two-phase transfer) are added to Cloudflare.GlobalProps.durableNamespaces, which types ctx.exports.X for unbound Durable Objects declared only via exports.

  • #14423 be3f792 Thanks @akshitsinha! - Add wrangler flagship commands for managing Flagship apps and feature flags.

    The new wrangler flagship apps and wrangler flagship flags command groups let you create, list, get, inspect, update, set, split, rollout, enable, disable, evaluate, and delete Flagship apps and flags from the CLI, including targeting rules, variations, percentage rollouts, evaluation context, and flag changelogs.

  • #14156 e1532eb Thanks @petebacondarwin! - Add opt-in OS keychain storage for OAuth credentials

    By default wrangler stores your OAuth tokens in a plaintext file, and that is unchanged. You can now opt in to encrypting them at rest instead: wrangler login --use-keyring writes the tokens to an AES-256-GCM-encrypted file whose key is held in your OS keyring (macOS Keychain, libsecret on Linux, or Windows Credential Manager). Existing plaintext credentials are migrated automatically on first use.

    Toggle it with any of:

    • wrangler login --use-keyring / --no-use-keyring
    • wrangler auth keyring enable / disable (or wrangler auth keyring to print the current setting) — useful if you only use named profiles and never run the global wrangler login
    • CLOUDFLARE_AUTH_USE_KEYRING=true|false to override the saved preference for a single command

    Opting out deletes the encrypted credentials rather than decrypting them back to disk, so you re-authenticate afterwards. The preference applies to every auth profile, and each named profile gets its own encrypted file and key.

    Per-platform requirements: macOS uses the built-in security tool (nothing to install); Linux uses secret-tool from libsecret-tools (wrangler prints an install hint if it is missing); Windows lazily installs @napi-rs/keyring (~1.9 MB) on first opt-in, and errors with instructions in non-interactive/CI contexts.

    CLOUDFLARE_API_TOKEN and CLOUDFLARE_API_KEY/CLOUDFLARE_EMAIL continue to take priority over any stored OAuth credentials.

Patch Changes

  • #14502 6b0ce98 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260630.1 1.20260701.1
  • #14306 bfe48db Thanks @matingathani! - Remove deprecated --experimental-vm-modules flag and prevent silent exit on unexpected errors

    wrangler was silently exiting with code 1 on Node.js v26 with no error message shown. This release fixes two independent issues that caused this behaviour:

    1. A stale Node.js flag that caused unexpected behaviour on Node.js v26 has been removed.

    2. If an error occurs in a situation where the normal error reporting path itself fails, wrangler now always prints the original error to stderr so the cause is visible rather than silently disappearing.

  • #14481 0277bfa Thanks @dario-piotrowicz! - Improve error message when deploying to a non-existent Pages project in non-interactive mode

    Previously, running wrangler pages deploy with a --project-name that doesn't exist in a non-interactive context (e.g. CI, piped input) would fail with a generic "project not found" or "This command cannot be run in a non-interactive context" error. Now it provides a specific error message explaining that the project doesn't exist and suggests how to create it. The error also suggests using wrangler deploy to deploy a Worker instead.

  • #14305 98793d8 Thanks @jbwcloudflare! - Improve asset upload performance with single-file uploads

    Asset uploads now use a more efficient per-file upload path when the platform enables it. This is rolled out server-side and requires no configuration changes. Existing upload behavior is unchanged when the new path is not enabled.

  • Updated dependencies [6b0ce98]:

4.106.0

Minor Changes

  • #14490 75d8cb0 Thanks @petebacondarwin! - Add wrangler ai-search jobs commands for managing AI Search indexing jobs

    You can now list, trigger, inspect, cancel, and read the logs of indexing jobs for an AI Search instance:

    wrangler ai-search jobs list <instance>
    wrangler ai-search jobs create <instance> --description "manual reindex"
    wrangler ai-search jobs get <instance> <job-id>
    wrangler ai-search jobs cancel <instance> <job-id>
    wrangler ai-search jobs logs <instance> <job-id>
    

    All commands accept --namespace/-n (defaults to default). All commands except cancel also accept --json for clean machine-readable output.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Add --source-jurisdiction to wrangler ai-search create for R2-backed instances

    R2 buckets can live in a specific jurisdiction (for example eu or fedramp). You can now point an AI Search instance at a bucket in one of those jurisdictions:

    wrangler ai-search create my-instance --type r2 --source my-bucket --source-jurisdiction eu

    When run interactively, the R2 source flow also prompts for a jurisdiction and lists (and can create) buckets within it. The value is a free-form string forwarded to the API as source_params.r2_jurisdiction (server-side validated); omit the flag for no specific jurisdiction. This AI Search command is in open beta.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Add auth profiles for managing multiple OAuth logins

    Auth profiles let you maintain separate OAuth logins and bind them to directories, so you can switch between different accounts for different projects without having to re-login.

    For example:

    wrangler auth create work
    wrangler auth activate work ~/projects/work
    
    wrangler auth create personal
    wrangler auth activate personal ~/projects/personal
    

    New commands under wrangler auth:

    • wrangler auth create <name> — create or re-authenticate a named profile via OAuth
    • wrangler auth delete <name> — delete a profile and all its directory bindings
    • wrangler auth activate <name> [dir] — bind a profile to a directory (defaults to cwd). Sub-directories will inherit this profile.
    • wrangler auth deactivate [dir] — remove a directory binding
    • wrangler auth list — list all profiles and their corresponding directories

    There is also a new global --profile flag, which you can use to activate a profile for just that command run. Note that if you have CLOUDFLARE_API_TOKEN set, that will still take precedence over all profiles. Any account id settings (via CLOUDFLARE_ACCOUNT_ID or wrangler config) will also still be respected.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Add --strict flag to wrangler versions upload and improve pre-upload safety checks

    wrangler versions upload now runs the same pre-upload checks as wrangler deploy:

    • When the Worker was last edited via the Cloudflare Dashboard, the local and remote configurations are diffed and you are warned only if the diff is destructive (previously, an unconditional warning was shown).
    • When local configuration values conflict with remote secrets, a warning is shown before proceeding.
    • When deploying workflows that belong to a different Worker, a warning is shown before proceeding.

    The new --strict flag (already available on wrangler deploy) causes wrangler versions upload to abort in non-interactive/CI environments when any of these conflicts are detected, instead of auto-continuing.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Add D1 migration setup to createTestHarness() Worker handles

    Tests using createTestHarness() can now apply local D1 migrations before running requests:

    const worker = server.getWorker();
    
    beforeEach(async () => {
      await worker.applyD1Migrations("DATABASE");
    });
    
  • #14490 75d8cb0 Thanks @petebacondarwin! - Add Workflow introspection to createTestHarness()

    Worker handles can now introspect Workflow bindings by name, allowing tests to disable sleeps, mock step results, and wait for Workflow outcomes. Tests can introspect a known Workflow instance by ID or track instances created after introspection starts.

    const harness = createTestHarness({
    	workers: [{ configPath: "./wrangler.json" }],
    });
    
    const worker = harness.getWorker();
    await using workflow = await worker.introspectWorkflow("MY_WORKFLOW");
    
    await workflow.modifyAll((modifier) =>
    	modifier.disableSleeps([{ name: "wait-for-approval" }])
    );
    
    const response = await worker.fetch("/start-workflow");
    const [instance] = await workflow.get();
    await instance.waitForStatus("complete");
    
  • #14446 e0cc2cb Thanks @edmundhung! - Add bindingOverrides and getExport() to createTestHarness()

    Test harness workers loaded from Wrangler config files can now replace a configured binding with a Worker in the same harness. This is useful for replacing platform bindings with test Workers while keeping the source Worker config production-like. You can also call getExport() on a Worker returned by server.getWorker(name) to access JSRPC methods on the default Worker export, including mock Workers used as override targets.

    const server = createTestHarness({
      workers: [
        {
          configPath: "./workers/app/wrangler.jsonc",
          bindingOverrides: { BROWSER: "mock-browser" },
        },
        {
          // A mock Worker implementing the Browser Rendering binding named "mock-browser".
          configPath: "./workers/mock-browser/wrangler.jsonc",
        },
      ],
    });
    
    const mockBrowser = await server
      .getWorker<WebEnv, typeof import("./workers/mock-browser")>("mock-browser")
      .getExport();
    await mockBrowser.setScreenshot(stubPng);
    
    const response = await server.fetch("/reports/2026-05-29.png");
    expect(await response.bytes()).toEqual(stubPng);
    
  • #14490 75d8cb0 Thanks @petebacondarwin! - Improve wrangler tail resilience and shutdown behaviour

    wrangler tail previously crashed with a raw stack trace when the keep-alive ping to the Worker timed out, and could exit with an ugly error on Ctrl-C.

    • Errors now flow through wrangler's usual error pipeline instead of escaping as uncaught exceptions.
    • The keep-alive timeout message now clearly explains what happened and no longer prints a stack trace.
    • When the tail connection drops unexpectedly, wrangler tail now automatically tries to reconnect with exponential back-off (up to 5 retries).
    • Ctrl-C now prints a short "Stopping tail..." message (in pretty mode), awaits the server-side tail deletion, and exits cleanly with code 0.

Patch Changes

  • #14490 75d8cb0 Thanks @petebacondarwin! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260625.1 1.20260629.1
  • #14478 f10d4ad Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260629.1 1.20260630.1
  • #14490 75d8cb0 Thanks @petebacondarwin! - Improve the deploy warning shown when a Workflow name already belongs to another Worker

    The warning still notes that deploying reassigns the workflow to the current Worker, and now also explains why this happens (workflow names must be unique per account) and how to resolve it (rename the workflow in the Wrangler config).

  • #14490 75d8cb0 Thanks @petebacondarwin! - use stream instead of deprecated pipeline key in pipelines setup config snippet

    The wrangler pipelines setup and wrangler pipelines create commands now output the correct stream property name in the configuration snippet, matching the rename from pipeline to stream that was applied across the rest of the codebase.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Improve KV error messages to be clearer and more actionable

    Error messages for KV namespace and key operations now consistently explain what went wrong, which flags or config fields to use, and what commands to run as alternatives. This covers namespace selection errors (delete, rename), binding resolution errors, config file issues, and preview namespace ambiguity.

  • #14479 d292046 Thanks @dario-piotrowicz! - Improve R2 error messages to be clearer and more actionable

    Error messages for r2 bucket lifecycle, r2 bucket lock, r2 bucket catalog, and r2 sql commands now include the specific flag or argument that is missing or invalid, along with usage examples showing the correct syntax.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Improve wrangler versions deploy error messages for non-interactive usage

    Error messages in wrangler versions deploy are now clearer and more actionable, especially for non-interactive and agent-driven usage. Each error now explains what went wrong, what was expected, and how to fix it (e.g. suggesting the correct flag or command syntax).

  • #14490 75d8cb0 Thanks @petebacondarwin! - Fix the remote secrets override check during deploy targeting the wrong Worker when --name is passed

    The check that warns when a config value would override an existing remote secret was using the Worker name from the config file rather than the resolved name. If you passed --name <other-worker>, the check ran against the config-file Worker name instead of the Worker actually being uploaded.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Abort in-flight custom builds when wrangler dev exits or restarts a build

    Previously, wrangler dev marked in-flight custom builds as stale but did not pass the abort signal to the spawned build command. This meant Ctrl-C could appear to hang while Wrangler waited for a custom build command to finish naturally. Custom build commands are now cancelled when the dev session tears down or a newer watched build supersedes them.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Replace existing bindings when adding newly created resources to Wrangler configuration

    When config updates are authorized interactively or through --update-config or --binding, Wrangler now replaces an existing resource binding with the selected name instead of adding a duplicate entry. This allows template bindings with placeholder resource IDs to be updated in both interactive and non-interactive workflows.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Verify Docker is installed and running before wrangler containers build

    Previously, running wrangler containers build without Docker installed or with the Docker daemon stopped would fail with an unhelpful spawn error. Now the command checks that Docker is reachable upfront and shows a clear, actionable error message with installation and troubleshooting steps.

  • #14490 75d8cb0 Thanks @petebacondarwin! - Add images as a valid --source for queues subscription create

    The Cloudflare Images service can emit events (e.g. image.uploaded) to a Cloudflare Queue via the event subscriptions API, and this is supported by both the REST API and the Cloudflare Dashboard. However, the wrangler CLI was missing images from the hardcoded --source choices list, causing the command to reject it with an "Invalid values" error.

    You can now subscribe a queue to Cloudflare Images events via the CLI:

    wrangler queues subscription create <queue> --source images --events image.uploaded
    
  • Updated dependencies [75d8cb0, f10d4ad, 75d8cb0, 75d8cb0]:

4.105.0

Minor Changes

  • #14311 34e0cef Thanks @sherryliu-lsy! - Add Google Artifact Registry support to containers registries configure

    wrangler containers registries configure now recognizes *-docker.pkg.dev (Google Artifact Registry) domains.

    • The Google service account email is the public credential, supplied with --gar-email. It must match the client_email in the service account key.
    • The service account JSON key is the private credential. It is provided via stdin (a file path, raw JSON, or base64) or an interactive prompt (a file path or base64) — never as a CLI flag, so it does not appear in shell history. The key is validated against --gar-email and stored base64-encoded.
    • Secret reuse inherits the existence-first flow: when the target Secrets Store secret already exists, it is reused by reference and the key is not required. In that case the email cannot be verified locally; it is validated against the key when images are pulled.
    <path-to-key>.json | npx wrangler@latest containers registries configure <region>-docker.pkg.dev --gar-email=<service-account-email> --secret-name=Google_Service_Account_JSON_Key
    

Patch Changes

  • #14424 5f40dd5 Thanks @MattieTK! - Bump am-i-vibing from 0.4.0 to 0.5.0

    This updates the agentic environment detection library to the latest version, which adds detection for the Pi coding agent (earendil-works/pi).

  • #14406 3b743c1 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260623.1 1.20260625.1
  • #14343 daa5389 Thanks @th0m! - Use digest-pinned image references for Dockerfile container deploys

    Dockerfile-backed container deploys now use the pushed image digest when deploying the container application. This lets snapshot-enabled container apps pass Cloudchamber validation while keeping local, non-pushed builds and registry image URI deploys unchanged.

  • #14394 8a5cf8c Thanks @Partha-Shankar! - fix(d1): escape migrationsTableName and filenames in SQLite queries

    D1 migration commands in both wrangler and @cloudflare/vitest-pool-workers interpolated the migrationsTableName config value and migration filenames directly into SQL strings without any escaping. This meant:

    • A table name such as my"table would produce invalid SQL in CREATE TABLE, SELECT, and INSERT statements, and
    • A migration filename containing an apostrophe (e.g. what's-new.sql) would break the INSERT INTO ... VALUES ('...') statement appended after each migration in wrangler.

    Both identifiers are now properly escaped before interpolation: migrationsTableName is wrapped in double-quotes with internal double-quotes doubled (SQL-standard identifier quoting), and migration filenames used as string literals have their single-quotes doubled before insertion.

  • Updated dependencies [3b743c1]:

4.104.0

Minor Changes

  • #14369 e312dec Thanks @edmundhung! - Add getEnv() to createTestHarness() Worker handles

    Tests can now access the full env object for a Worker with await server.getWorker<Env>().getEnv(), including vars, secrets, and bindings.

Patch Changes

  • #14364 a085dec Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260617.1 1.20260619.1
  • #14383 9a0de8f Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260619.1 1.20260621.1
  • #14397 fab565f Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260621.1 1.20260623.1
  • #14388 3f02864 Thanks @petebacondarwin! - Stop erroring when find_additional_modules discovers a file that only matches a inactive module rule

    Module rules assign module types to imported files — they are not include/exclude filters. Also, setting fallthrough: false in a rule will cause subsequent rules to become inactive. Previously, when find_additional_modules walked the filesystem and discovered a file whose only matching rule is inactive, Wrangler would throw an error and fail the build.

    This meant that adding a user rule like the one below would break the build for any .txt, .html, .sql, .bin or .wasm file that didn't match the user-supplied globs but lived somewhere under the module root:

    // wrangler.json
    {
      "rules": [
        {
          "type": "Text",
          "globs": ["html/includeme.html"],
          "fallthrough": false
        }
      ]
    }
    

    Discovered files that only match an inactive rule are now silently skipped (a debug-level log records each skip for troubleshooting), so users can use fallthrough: false to narrow the set of files attached to their Worker without having to delete or move untouched files on disk.

    The direct-import path is unchanged: importing a file in code that only matches an inactive rule is still a hard error, because the imported file genuinely needs a defined module type.

    Fixes #14257.

  • #14358 4ef872f Thanks @gabivlj! - Fix container egress interception on arm64 Docker runtimes

    Both wrangler dev and the Cloudflare Vite plugin no longer force the proxy-everything sidecar image to pull as linux/amd64, allowing Docker to select the native image from the multi-platform manifest. Set MINIFLARE_CONTAINER_EGRESS_IMAGE_PLATFORM to force a specific platform when needed.

  • #14362 2a02858 Thanks @sherryliu-lsy! - Don't require the private credential when reusing an existing Secrets Store secret in containers registries configure

    wrangler containers registries configure now checks whether the target Secrets Store secret already exists before resolving the private credential. When the secret already exists it is reused by reference, so the private credential no longer needs to be supplied (via stdin in non-interactive mode, or via a prompt interactively). This applies to all external registries.

    The new-secret path is unchanged: the credential is still required and stored. The only visible interactive change is that the secret prompt now appears last and only when a new secret is being created.

  • Updated dependencies [a085dec, 9a0de8f, fab565f]:

4.103.0

Minor Changes

  • #14295 cfd6205 Thanks @dario-piotrowicz! - Move unstable_getWorkerNameFromProject from wrangler to @cloudflare/workers-utils

    The unstable_getWorkerNameFromProject export has been removed from the wrangler package. This function is now available as getWorkerNameFromProject (without the unstable_ prefix) from @cloudflare/workers-utils. If you were importing this function from wrangler, update your import to use @cloudflare/workers-utils instead.

  • #14295 cfd6205 Thanks @dario-piotrowicz! - Remove experimental autoconfig exports

    The experimental autoconfig exports (experimental_getDetailsForAutoConfig, experimental_runAutoConfig, experimental_AutoConfigFramework) have been removed. This logic has been moved to the @cloudflare/autoconfig package (without the experimental_ prefixes since the package itself is pre-v1).

Patch Changes

  • #14366 c6579d3 Thanks @jamesopstad! - Resolve relative cf-worker entrypoint imports relative to the importing module

    When loading the experimental cloudflare.config.ts, a relative entrypoint imported with import ... with { type: "cf-worker" } (e.g. ./src/index.ts) is now anchored to the module where the import is written, rather than being passed through verbatim and later resolved against the top-level config file. This fixes incorrect resolution when the import lives in a file other than the entry config — for example a config that re-exports from a nested file.

    Bare specifiers (such as @scope/pkg) and virtual modules (such as virtual:foo) are still left unresolved so that consumers can apply their own resolution.

  • #14316 444b75e Thanks @matingathani! - Prevent wrangler dev crash when source-mapping a truncated error chunk

    When a worker logs many errors in quick succession, the stderr chunks received by wrangler dev can be truncated mid-stack-frame, leaving a call site with an invalid column number. The source map library throws in that case, which was crashing the wrangler process entirely. The error is now caught and the original (un-source-mapped) text is returned instead.

  • #14118 b38823f Thanks @aicayzer! - Fix Uint8Array step outputs in local Workflows being persisted with the full backing ArrayBuffer

    A Uint8Array returned from a Workflows step under wrangler dev was serialised together with its full underlying ArrayBuffer, causing a raw SQLITE_TOOBIG error at view sizes well below the documented 1MiB step-output limit. For example, a 200KB view sliced from an 800KB buffer (a common pattern from crypto.getRandomValues or arr.slice(...) on a larger pool) would fail. The view's bytes are now copied to a tight buffer before persistence, bringing local behaviour in line with production. Fixes #14101.

  • Updated dependencies [b38823f]:

4.102.0

Minor Changes

  • #14340 f6e49dd Thanks @emily-shen! - Add cf-wrangler build delegate support

    The experimental cf-wrangler delegate binary now accepts build and emits the Build Output API directory through Wrangler's new-config build path. This lets parent tools invoke Wrangler's build-output implementation with cf-wrangler build instead of shelling out through the public Wrangler CLI.

  • #14324 36777db Thanks @jamesopstad! - Add experimental --experimental-cf-build-output flag to wrangler build

    When used alongside --experimental-new-config, wrangler build now emits a self-contained Build Output API directory under .cloudflare/output/v0/ instead of delegating to wrangler deploy --dry-run.

Patch Changes

  • #14347 673b09e Thanks @jamesopstad! - Update undici from 7.24.8 to 7.28.0

  • #14346 e930bd4 Thanks @haidargit! - Bump ws from 8.20.1 to 8.21.0 to address GHSA-96hv-2xvq-fx4p

    GHSA-96hv-2xvq-fx4p / CVE-2026-48779 (high severity) reports a remote memory-exhaustion DoS in ws@<8.21.0: a peer sending a high volume of tiny fragments and data chunks over modest network traffic can crash a ws server or client via OOM. The fix shipped in ws@8.21.0 (commit 2b2abd45, released 2026-05-22), which also introduces the maxBufferedChunks and maxFragments options. This change bumps the workspace catalog entry so that miniflare, wrangler, and @cloudflare/vite-plugin all pick up the patched release.

  • #14314 5c3bb11 Thanks @harryzcy! - Bump esbuild to 0.28.1

    This update includes several bug fixes from esbuild versions 0.27.3 through 0.28.1. See the esbuild changelog for details.

  • #14331 296ad65 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260616.1 1.20260617.1
  • #14275 594544d Thanks @alsuren! - Resolve auto-provisioned D1 bindings via the API in remote subcommands

    Remote D1 subcommands (d1 execute --remote, d1 export --remote, d1 info, d1 insights, d1 delete, d1 migrations apply --remote, d1 migrations list --remote, d1 time-travel) previously failed with:

    Found a database with name or binding DB but it is missing a database_id, which is needed for operations on remote resources.

    when the [[d1_databases]] config entry only had binding and database_name (the shape wrangler deploy writes for automatically-provisioned bindings). They now resolve the real database UUID via GET /accounts/:accountId/d1/database/:name?fields=uuid and proceed as if database_id had been set in config.

    If the config entry only has a binding (no database_name, no database_id), the lookup uses the same name wrangler deploy would create via auto provisioning (<worker name>-<binding-lowercased-with-dashes>).

    Non-404 API failures (auth, rate-limit, server errors) now propagate verbatim instead of being masked as "database not found".

  • #14315 a79b899 Thanks @matingathani! - Respect find_additional_modules = false when no_bundle is set

    When using no_bundle = true, wrangler was always scanning for and attaching additional modules even if find_additional_modules was explicitly set to false in the config. Additional modules are now only collected when find_additional_modules is not false, consistent with the bundled code path.

  • #14269 5dfb788 Thanks @mattjohnsonpint! - Support dev.plugin on typed services bindings

    Wrangler only honored dev.plugin on unsafe.bindings entries, so users authoring a service binding via services[] could not wire it to a local Miniflare plugin during wrangler dev — they had to fall back to unsafe.bindings and accept a "directly supported by wrangler" warning. Typed services bindings now accept the same dev: { plugin, options? } shape, route the binding through Miniflare's external-plugin pathway in wrangler dev, and strip the field at deploy time. Validation rejects malformed dev shapes.

  • #14328 ca61558 Thanks @edevil! - Mention temporary preview accounts in wrangler whoami output when unauthenticated

    When you run wrangler whoami without being logged in, Wrangler now also tells you that you can deploy without logging in by running a command like wrangler deploy --temporary to use a temporary preview account.

  • Updated dependencies [673b09e, e930bd4, 5c3bb11, 296ad65]:

4.101.0

Minor Changes

  • #14276 32f9307 Thanks @dario-piotrowicz! - Graduate autoconfig from experimental to stable

    The --experimental-autoconfig and --x-autoconfig deploy CLI flags have been replaced with --autoconfig.

    Note that the --autoconfig flag defaults to true and that it can be used to disable Wrangler's auto-configuration logic by setting it to false via --autoconfig=false or --no-autoconfig

  • #14287 41f391f Thanks @edmundhung! - Add per-Worker resource accessors to createTestHarness()

    createTestHarness() now provides methods for accessing configured KV namespaces, R2 buckets, D1 databases, and Durable Object namespaces. Use server.getWorker(name) to access resources scoped to that specific Worker:

    const worker = server.getWorker("api-worker");
    const bucket = await worker.getR2Bucket("BUCKET");
    const db = await worker.getD1Database("DB");
    
  • #14264 21dbc12 Thanks @dario-piotrowicz! - Suggest Cloudflare skills installation after commands instead of before

    The automatic prompt to install Cloudflare skills for detected AI coding agents no longer runs before every Wrangler command. Instead, Wrangler now suggests installing skills, when appropriate, after some commands complete successfully. Commands that output JSON suppress the suggestion to keep their output clean. The --install-skills flag remains available on all commands to explicitly run the skills installation flow before the command executes, without prompting.

    As before, Wrangler asks the skills installation question at most once. The skills install metadata file is now written before the confirmation prompt is shown, so even if the user interrupts the process (e.g. CTRL+C, closing the terminal) during the prompt, the question is recorded as unanswered and will not reappear on subsequent runs.

  • #14042 7e63948 Thanks @edevil! - Add a --temporary flag that creates and uses a temporary Cloudflare preview account when you have no credentials, instead of starting the OAuth login flow.

    It's registered only on the commands the short-lived account token can serve — Workers (deploy, versions upload, and related commands), KV, D1, Hyperdrive, Queues, and certificate commands — and is for unauthenticated use only: passing it while already authenticated (OAuth, CLOUDFLARE_API_TOKEN, or a global API key) errors rather than silently ignoring the flag. Before provisioning, Wrangler handles Cloudflare's Terms of Service and Privacy Policy (interactive terminals prompt for yes; non-interactive shells print a notice and continue). Wrangler then runs with the short-lived token and prints a claim URL so the account can be claimed before it expires. The cached account is cleared on successful login or logout.

  • #14299 035917f Thanks @petebacondarwin! - Send the login user telemetry event when wrangler login --scopes ... succeeds

    wrangler login was already reporting the login user event when called without --scopes, but the scoped login path returned early before the event could be sent. Both paths now report the event, so successful scoped logins are counted alongside unscoped ones.

Patch Changes

  • #14271 27db82c Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260611.1 1.20260612.1
  • #14298 2a6a26b Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260612.1 1.20260615.1
  • #14317 9a424ed Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260615.1 1.20260616.1
  • #14282 ecfdd5a Thanks @edmundhung! - Fix wrangler dev asset fallback with custom routes

    wrangler dev now applies Workers Assets fallback behavior consistently when routes are configured, including SPA fallback and 404-page handling.

  • #13763 604be26 Thanks @matingathani! - Show a clear error when deploying a service-worker format Worker with Durable Object migrations or bindings instead of an opaque API error

  • #14240 1fb7ba5 Thanks @ttoino! - Fix wrangler email sending commands

    The email sending commands previously failed against the Cloudflare API. They now work as expected:

    • email sending enable <domain> enables Email Sending for a domain
    • email sending disable <domain> disables Email Sending for a domain
    • email sending settings <domain> shows the Email Sending configuration for a domain
    • email sending dns get <domain> shows the DNS records to set up for a domain
    • email sending list previously listed zones. It now lists the domains that have Email Sending enabled — every enabled domain across your account by default, or just those under a specific domain when you pass a domain (or --zone-id).
  • #13838 208b3bb Thanks @matingathani! - Fix unhandled promise rejection when the worker entry point is deleted or moved during wrangler dev hot-reload — now logs a warning and skips the update instead of crashing

  • #14241 8b2ce41 Thanks @dario-piotrowicz! - Improve error messages for CLI flags, type generation, auth scopes, dev server tunnels, and compatibility flags

    Error messages across several areas now name the exact flags or values involved and suggest how to fix the problem:

    • KV commands (kv key put, kv key get, kv key delete): error messages now include -- prefixes and clear "Missing required option" / "Conflicting options" phrasing instead of the vague "Exactly one of the arguments ... is required".
    • wrangler types --include-env=false --include-runtime=false: the error now names both flags and explains what each does.
    • wrangler login --scopes: invalid scopes are individually identified instead of dumping the entire array.
    • wrangler dev --tunnel --remote: the error now explains why tunnels require local mode and suggests two concrete fixes.
    • Conflicting compatibility flags (nodejs_compat_populate_process_env / nodejs_compat_do_not_populate_process_env, global_navigator / no_global_navigator): errors now name the specific conflicting flags.
  • #14228 3578919 Thanks @dario-piotrowicz! - Improve Hyperdrive error messages for missing required options

    Error messages thrown when creating or updating a Hyperdrive config with missing individual parameters (e.g. --origin-host, --origin-port, --database, --origin-user, --origin-password, --origin-scheme, --access-client-id/--access-client-secret) now clearly state which option is missing, provide a usage example, and suggest --connection-string as an alternative where applicable.

  • #14304 ee82c76 Thanks @emily-shen! - Skip resource provisioning for asset-only deployments

    Previously, asset-only deployments would provision resources even when there was no user Worker script. On a subsequent deploy, we would re-attempt provisioning as the previous asset-only upload would/could not be bound to the previously provisioned resource. Provisioning would then error as the resource had already been created, blocking the deploy.

  • Updated dependencies [0e055d3, 27db82c, 2a6a26b, 9a424ed, 41f391f]:

4.100.0

Minor Changes

  • #14119 2047a32 Thanks @tahmid-23! - Serve local R2 bucket objects publicly via the dev server

    When running wrangler dev locally, objects in each local R2 binding are now reachable under /cdn-cgi/local/r2/public/<bucket-id>/<key> on the existing dev server, simulating a public bucket. The <bucket-id> is the bucket's bucket_name when set, otherwise its binding. Bindings configured with remote: true are not exposed.

  • #14202 e8561c2 Thanks @jamesopstad! - Add experimental --x-new-config flag for authoring config in TypeScript

    This is an experimental, opt-in feature. When enabled, wrangler dev, wrangler build, wrangler deploy, wrangler versions upload, and wrangler versions deploy load the Worker's configuration from a cloudflare.config.ts file instead of wrangler.json / wrangler.jsonc / wrangler.toml. Additionally, an optional wrangler.config.ts file can be provided for Wrangler-specific dev/build configuration.

    • cloudflare.config.ts (required) — Worker runtime configuration (bindings, triggers, observability, placement, limits, compatibility, routes, etc.). Authored via defineWorker from wrangler/experimental-config.
    • wrangler.config.ts (optional) — Tooling / bundling / dev-server configuration (noBundle, minify, alias, define, rules, tsconfig, build, dev, assetsDirectory, etc.). Authored via defineWranglerConfig from wrangler/experimental-config.

    Per-environment configuration is via ctx.mode branching inside the function form of either file.

    Example cloudflare.config.ts:

    import { defineWorker, bindings } from "wrangler/experimental-config";
    import * as entrypoint from "./src/index.ts" with { type: "cf-worker" };
    
    export default defineWorker((ctx) => ({
    	name: "my-worker",
    	entrypoint,
    	compatibilityDate: "2026-05-18",
    	env: {
    		MY_KV: bindings.kv(),
    		MY_TEXT: bindings.text(`The mode is ${ctx.mode}`),
    	},
    }));
    

    Example wrangler.config.ts:

    import { defineWranglerConfig } from "wrangler/experimental-config";
    
    export default defineWranglerConfig({
      minify: true,
      assetsDirectory: "./public",
    });
    

    Because this is experimental, the flag, the config formats, and the wrangler/experimental-config exports may change in any release.

Patch Changes

  • #14185 98c9afe Thanks @penalosa! - Use the shared env-credential resolver from @cloudflare/workers-auth

    No user-facing behaviour change. Credential resolution order (global API key + email → CLOUDFLARE_API_TOKEN → stored OAuth token) is preserved.

  • #14184 e305126 Thanks @penalosa! - Add an experimental cf-wrangler delegate entrypoint for projects that can't use @cloudflare/vite-plugin (service workers, old compatibility dates, Python, Rust, etc.).

    cf-wrangler dev starts the same local dev server as wrangler dev — it sits directly on wrangler's internal dev server, so the bundling and runtime behaviour are identical — but exposes a deliberately narrow CLI surface (--mode, --port, --host, --local) for a parent CLI to delegate to, and other dev server config options are read from the wrangler config file.

    This replaces the separate @cloudflare/wrangler-bundler package. This is an internal integration point and is not intended to be run directly by users.

  • #14246 f3990b2 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260609.1 1.20260610.1
  • #14256 4597f08 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260610.1 1.20260611.1
  • #14243 25722ac Thanks @com6056! - Fix a memory leak that could make long-running headless wrangler dev sessions unresponsive

    Long-running wrangler dev sessions with no DevTools attached (for example using the containers feature under sustained traffic) could gradually consume unbounded memory and eventually stop accepting connections. The inspector proxy now only enables network tracking while a DevTools client is connected, so the buildup no longer happens. Interactive debugging is unaffected. Fixes #14191.

  • #14230 41f75c0 Thanks @dario-piotrowicz! - Improve D1 error messages for missing or conflicting options

    Error messages for d1 execute, d1 export, d1 time-travel restore, and d1 insights now clearly state which option is missing or conflicting, explain why the combination is invalid, and suggest how to fix the issue.

    Additionally, duration validation errors in d1 insights are now thrown as UserError instead of plain Error, ensuring they are displayed cleanly to users rather than as unexpected crashes.

  • #14213 10b5538 Thanks @dario-piotrowicz! - Improve authentication error messages with specific failure reasons

    When authentication fails (e.g. during wrangler dev --remote or when using remote bindings), the error message now explains exactly what went wrong -- whether no credentials were found, the token expired, or the environment is non-interactive -- and lists actionable steps to fix it, including a wrangler whoami tip.

    Previously, auth failures could produce multiple confusing errors (e.g. "Failed to fetch auth token: 400 Bad Request" followed by "Failed to start the remote proxy session"). Now a single, clear error is shown.

  • #14233 818c105 Thanks @dario-piotrowicz! - Improve R2 Sippy error messages

    Now error messages in wrangler r2 bucket sippy follow a consistent pattern: they describe what is missing, name the exact --flag to use, and provide context (e.g. example values, links to the dashboard). Previously, many errors said only "Error: must provide --flag." with no guidance on what the flag does or how to obtain the value.

  • #14259 2ae6099 Thanks @emily-shen! - Move worker build step earlier in deploy/upload step, before upload specific config validation

  • Updated dependencies [f3990b2, 4597f08, 2047a32]:

4.99.0

Minor Changes

  • #14169 0706fbf Thanks @edmundhung! - Introduce createTestHarness() for integration testing Workers

    It runs Workers in a local preview environment using production build output and works with both Wrangler projects and Workers built by the Cloudflare Vite plugin.

    Use it from any Node.js test runner to send requests to individual Workers, trigger scheduled events, reset the server between tests, and mock outbound requests with libraries that intercept globalThis.fetch(), such as MSW.

    You can also capture structured logs from your Workers with getLogs(), or dump out a diagnostic timeline with debug() when tests fail:

    import { createTestHarness } from "wrangler";
    
    const server = createTestHarness({
      workers: [
        { configPath: "./dist/web_worker/wrangler.json" },
        { configPath: "./dist/api_worker/wrangler.json" },
      ],
    });
    
    await server.listen();
    await server.fetch("http://example.com");
    
    const apiWorker = server.getWorker("api-worker");
    await apiWorker.fetch("http://example.com/users/123");
    await apiWorker.scheduled({ cron: "0 0 * * *" });
    
    server.getLogs();
    
    if (testFailed) {
      server.debug();
    }
    
    await server.reset();
    await server.close();
    
  • #14174 8cf8c61 Thanks @oliy! - Surface pipeline status and failure reasons in wrangler pipelines list and wrangler pipelines get

    wrangler pipelines list now includes a Status column, and when any pipelines are in a failed state it prints a summary of each failing pipeline along with the reason reported by the API.

    wrangler pipelines get now shows the pipeline Status in the general details and, for failed pipelines, highlights the failure with the reason returned by the server so it is clear why a pipeline is not running.

  • #14211 a61ac29 Thanks @james-elicx! - Add --version-tag support to wrangler versions deploy to deploy a version by its tag

    You can now roll out or roll back a version by the tag it was uploaded with (e.g. a commit SHA passed to --tag at upload time) instead of first looking up its Version ID:

    wrangler versions deploy --version-tag <sha>@100%

    The tag is resolved to a Version ID against the worker's deployable versions, and the <version-tag>@<percentage> shorthand works just like the existing <version-id>@<percentage> notation, including splitting traffic across multiple --version-tag values. If a tag matches no deployable version, or matches more than one, the command errors and asks you to deploy by Version ID directly. Note that tags can only be resolved against recent (deployable) versions — older versions that have aged out of that window must still be deployed by Version ID.

Patch Changes

  • #14163 23aecac Thanks @emily-shen! - Print deploy warnings even in non-interactive contexts when strict mode is off

    Currently, wrangler deploy checks whether the incoming deploy configuration has destructive conflicts with the current configuration. Previously, we only performed this check in interactive contexts, or if the --strict flag was passed in. Now this warning is always printed, and it remains non-blocking in non-interactive contexts.

  • #14173 b932e47 Thanks @gpanders! - Handle API validation errors from wrangler containers ssh

    Wrangler now lets the Containers API validate SSH instance IDs and preserves raw API error bodies such as INVALID_INSTANCE_ID when reporting validation failures.

  • #14192 d076bcc Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260603.1 1.20260605.1
  • #14217 24497d0 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260605.1 1.20260608.1
  • #14231 4bb572f Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260608.1 1.20260609.1
  • #14195 165adb2 Thanks @dario-piotrowicz! - Show actionable error message when authentication fails during remote dev

    When wrangler dev with remote bindings encountered an authentication error (expired token, revoked OAuth, or invalid API token), the user saw a generic "A request to the Cloudflare API failed" message with no indication that authentication was the problem.

    Now, authentication failures during remote dev display a clear error message with actionable steps.

  • #14034 776098c Thanks @matingathani! - Fix wrangler types --check reporting types as out of date in multi-worker setups

    Previously, running wrangler types --check -c primary/wrangler.jsonc in a multi-worker project would incorrectly report types as out of date, even when they were current. This happened because the secondary worker config paths (passed via additional -c flags during generation) were not stored in the generated types file header, so --check had no way to resolve the secondary workers' service bindings when verifying the hash.

    The fix stores secondary config paths in the generated file's header comment so that --check can recover them automatically. Users no longer need to re-pass every -c flag when running --check — only the primary config is required.

  • #14053 7993711 Thanks @fallintoplace! - Prevent delete-only wrangler secret bulk input from creating a new Worker

    Previously, wrangler secret bulk could create a draft Worker when the input only deleted secrets and the target Worker name did not exist. Delete-only bulk secret operations now leave Worker-not-found as an error instead of creating a new Worker.

  • #14055 8923f97 Thanks @dario-piotrowicz! - Preserve all deployment-affecting CLI flags in the interactive deploy config flow

    When running wrangler deploy without a config file and going through the interactive setup flow, CLI flags beyond --compatibility-flags (such as --routes/--route, --domains/--domain, --triggers, --var, --define, --alias, --jsx-factory, --jsx-fragment, --tsconfig, --minify, --upload-source-maps, --no-bundle, --logpush, --keep-vars, --legacy-env, and --dispatch-namespace) were silently dropped. These flags are now persisted to the generated wrangler.jsonc config file (where a config field equivalent exists) and included in the suggested CLI command when the user declines config file generation.

  • #14196 b205fb7 Thanks @odiak! - Validate JSON stdin values for wrangler secret bulk

    JSON input piped through stdin now validates that secret values are strings or null before sending them to the API, matching the existing behavior for file input.

  • Updated dependencies [d076bcc, 24497d0, 4bb572f, 48c4ff0]:

4.98.0

Minor Changes

  • #14089 c6c61b5 Thanks @alsuren! - Add migrations_pattern to D1 database bindings

    The D1 binding now accepts an optional migrations_pattern field, allowing you to point wrangler d1 migrations apply and wrangler d1 migrations list at migration files in nested layouts (e.g. ORM-generated folders like migrations/0000_init/migration.sql).

    migrations_pattern is a glob (relative to the wrangler config file) and defaults to ${migrations_dir}/*.sql, which preserves today's behaviour. Files that do not match the pattern are not executed.

    {
      "d1_databases": [
        {
          "binding": "DB",
          "database_name": "my-db",
          "database_id": "...",
          "migrations_dir": "migrations",
          "migrations_pattern": "migrations/*/migration.sql"
        }
      ]
    }
    

    When no migrations match the configured pattern but files matching the common migrations/*/migration.sql (drizzle-style) layout do exist, Wrangler logs a hint suggesting migrations_pattern as an opt-in.

    wrangler d1 migrations create now returns an actionable error if the generated migration filename would not match the configured pattern.

  • #14153 7a6b1a4 Thanks @dario-piotrowicz! - Generalize wrangler deploy and wrangler versions upload positional argument from [script] to [path]

    Both wrangler deploy and wrangler versions upload now accept a generic [path] positional argument that can point to either a Worker entry-point file or a directory of static assets. The type is auto-detected. For example:

    • File: wrangler deploy ./src/index.ts deploys a Worker (same as before)
    • Directory: wrangler deploy ./public deploys a static assets site (no interactive confirmation prompt)

    The --script named option is now hidden and deprecated for both commands. It continues to work for backwards compatibility but only accepts file paths. Passing a directory to --script now produces a clear error message suggesting the positional path argument or --assets flag instead.

  • #13863 3b8b80a Thanks @aslakhellesoy! - getPlatformProxy() now passes through workflow bindings that have a script_name

    Workflows without a script_name are still stripped (and warned about) because the engine for an internal workflow can't run inside the empty proxy worker that backs getPlatformProxy(). Workflows with a script_name are handed to miniflare unchanged; miniflare reroutes the engine's USER_WORKFLOW binding through the dev-registry-proxy when the target worker is running in another Miniflare instance — the same mechanism Durable Objects already use.

    This means SvelteKit/Remix (and similar split-process setups) can call platform.env.MY_WORKFLOW.create({ ... }) directly from their server-side request handlers in dev, as long as the workflow class is exposed by another worker registered in the dev registry.

    Closes #7459.

  • #14164 b502d54 Thanks @G4brym! - Rename the web_search binding kind to websearch

    Pre-launch rename of the public binding type from web_search to websearch so the on-the-wire shape matches the product name (Web Search). The wrangler config key, the binding-type string sent to the Cloudflare API, and the miniflare option key all move from web_search / webSearch to websearch.

    Update your wrangler config:

    - "web_search": { "binding": "WEBSEARCH" }
    + "websearch": { "binding": "WEBSEARCH" }
    

    The runtime WebSearch type exposed on env.WEBSEARCH is unchanged.

Patch Changes

  • #14089 c6c61b5 Thanks @alsuren! - Restore the D1 executeSql logger level via try/finally

    wrangler d1 execute --json and the internal executeSql helper temporarily lower the global logger to "error" to keep human-readable output out of the JSON payload. Previously the level was restored only on the happy path, so any early return or thrown error left the singleton logger muted, silencing later logger.warn/logger.log output (notably from migration helpers that wrap executeSql and are commonly mocked in tests).

    The level swap is now wrapped in try/finally so it is always restored.

  • #14175 a3eea27 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260601.1 1.20260603.1
  • #14121 7539a9b Thanks @petebacondarwin! - Extract the OAuth 2.0 + PKCE flow into a new @cloudflare/workers-auth package.

    The OAuth login / logout / refresh logic, the auth-config TOML file IO, the OAuth token exchange + local callback server, and the Cloudflare Access detection helpers that previously lived in packages/wrangler/src/user/ have moved to the new internal-only @cloudflare/workers-auth package. Wrangler now wires the OAuth flow up via a small glue module that injects its logger, browser opener, interactivity detector, and config cache via a dependency- injection context.

    What stays in wrangler:

    • The yargs login / logout / whoami / auth token commands
    • Environment-based credential resolution (CLOUDFLARE_API_TOKEN, CLOUDFLARE_API_KEY / CLOUDFLARE_EMAIL, etc.)
    • Cloudflare account selection (requireAuth, getOrSelectAccountId)
    • The OAuth scope catalog (passed into the OAuth flow as a generic string[])
    • whoami / account fetching

    No behavior change for end users. The on-disk TOML format and location remain identical, and all telemetry message labels are preserved verbatim.

    @cloudflare/workers-auth is published with prerelease: true and is not intended for external use — its APIs may change without notice.

  • #14162 0bb2d55 Thanks @dario-piotrowicz! - In non-interactive mode remove the skills installation message

    When Wrangler run in non interactive mode and it detected agents that it could install skills for, it would print a message such as:

    Cloudflare agent skills are available for: <DETECTED_AGENTS>. Run wrangler in an interactive terminal to install them, or use '--install-skills' to install without prompting.

    This message seems to be confusing and unhelpful so it has now been removed.

  • #14165 8400fb9 Thanks @NuroDev! - Limit wrangler versions list to the 10 most recent deployable versions

    The versions API ignores pagination when filtering to deployable versions, so Wrangler now caps the command output client-side. This keeps the command aligned with its help text and avoids overwhelming terminal output for Workers with many versions.

  • #14151 7949f81 Thanks @dario-piotrowicz! - Skip stale bundles during dev server reload to avoid redundant restarts

    When rapidly saving a wrangler config file with remote bindings, each save would trigger a full reload cycle (remote connection setup, miniflare restart), causing many sequential "Reloading local server... / Establishing remote connection..." messages (while blocking the user). The runtime controllers now check whether a newer bundle has been queued at each expensive async boundary and bail out early if the current bundle is stale. This ensures that only the latest config change triggers a reload, making wrangler dev much more responsive during repeated config edits.

  • #14072 d462013 Thanks @himanshu-cf! - Update wrangler secret bulk command description to reflect create/update/delete capabilities

    The help text for wrangler secret bulk now accurately describes that the command can create, update, or delete multiple secrets in a single request, with up to 100 secrets per command. The file argument description also clarifies that setting a key to null in JSON will delete it, and that deletion is not supported with .env files.

  • #13979 c2280cd Thanks @matingathani! - Warn when a named environment silently inherits custom_domain routes from the top-level config

    When an env.<name> block does not override routes, it inherits the top-level routes array. If that array contains entries with custom_domain: true, every deploy to the named environment will silently reassign the custom domain away from the top-level Worker and towards the env Worker, causing routing drift. Wrangler now emits a warning in this situation and suggests adding "routes": [] to the env block to prevent inheritance.

  • #14170 ea12b58 Thanks @petebacondarwin! - Tighten on-disk permissions of the OAuth credentials file to 0600

    The user auth config file written by wrangler login (typically ~/.config/.wrangler/config/default.toml on Linux/macOS, or <environment>.toml for non-production Cloudflare API environments) is now written with mode 0600 and re-chmod-ed on every save. This prevents other local users on shared hosts from reading the stored OAuth tokens. Existing files with looser permissions written by older Wrangler versions are tightened the next time Wrangler refreshes the token or the user logs in again. The change is a no-op on Windows, which does not honour POSIX mode bits.

  • #14022 acf7817 Thanks @petebacondarwin! - Show the actual OAuth error instead of hanging when wrangler login is rejected by the OAuth provider (for example with invalid_scope).

    Previously, if the OAuth callback returned with an error other than access_denied, Wrangler would never respond to the browser. Because server.close()'s callback only fires once all open connections have ended, the login command would hang until the 120 second OAuth timeout — at which point it would print a generic timeout message rather than the actual OAuth failure. The same gap existed for the case where the OAuth provider redirected back without an authorisation code, and for failures during the auth-code-to-access-token exchange.

    The OAuth provider's error_description (RFC 6749 §4.1.2.1) is now also surfaced, so the message includes the specific reason for the failure rather than just the bare error code. For example, a misconfigured staging scope now surfaces as:

    OAuth error: invalid_scope
      The OAuth 2.0 Client is not allowed to request scope 'browser:write'.
    

    instead of hanging silently.

  • Updated dependencies [a3eea27, 1fdd8de, b502d54, 3b8b80a]:

4.97.0

Minor Changes

  • #13996 94b29f7 Thanks @vaishnav-mk! - Add restart-from-step options to wrangler workflows instances restart

    You can now restart a Workflow instance from a specific step using --from-step-name, with optional --from-step-count and --from-step-type disambiguation. These options work for both remote Workflow instances and local wrangler dev --local sessions.

Patch Changes

  • #14141 b210c5e Thanks @MattieTK! - Add re-authentication hint to account fetch error messages

    When Wrangler fails to automatically retrieve account IDs, the error messages now suggest running wrangler login as a troubleshooting step. This addresses confusion for users who encounter these errors after OAuth system changes or other authentication issues.

  • #14078 aec1bb8 Thanks @MattieTK! - Bump am-i-vibing from 0.1.1 to 0.4.0

    This updates the agentic environment detection library to the latest version, which includes improved detection coverage for newer AI coding agents.

  • #14147 e06cbb7 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260529.1 1.20260601.1
  • #14027 9a26191 Thanks @matingathani! - Gracefully handle EMFILE error when assets directory exceeds OS watcher limit

    Previously, when wrangler dev was pointed at an assets directory with more than ~4,096 subdirectories, the chokidar file watcher threw an EMFILE: too many open files error that was not caught, causing an infinite error loop that made the dev server unresponsive.

    Now the error is caught and wrangler:

    1. Logs a clear warning explaining the platform watcher limit was hit
    2. Recommends reducing the number of subdirectories by flattening or restructuring the assets directory
    3. Disables the assets watcher gracefully so the dev server continues working without hot-reload
  • #14041 5565823 Thanks @matingathani! - Fix wrangler complete printing the AI skills prompt into shell completion output

    Previously, running eval "$(wrangler complete zsh)" (or any other shell) would fail with errors like zsh: command not found: --install-skills because the interactive AI agent skills installation prompt was included in the completion script output.

    The skills prompt is now skipped when running wrangler complete, so the generated completion script is clean and can be sourced correctly.

  • #13881 890fca7 Thanks @matingathani! - Show a clear error when --metadata is not valid JSON instead of silently ignoring the value

  • #14149 6fc9777 Thanks @mattjohnsonpint! - Fix wrangler deploy --upload-source-maps silently skipping source maps when the entry file ends with magic comments after //# sourceMappingURL=

    Wrangler previously assumed the //# sourceMappingURL= comment was the last non-empty line of a module. Tools like sentry-cli sourcemaps inject append a //# debugId= comment after it, which silently caused source maps to be omitted from the upload form, most commonly when deploying with --no-bundle --upload-source-maps. Wrangler now scans trailing magic comments (lines starting with //# or //@) and detects the //# sourceMappingURL= comment regardless of which other magic comments follow it.

  • #14105 337e912 Thanks @dario-piotrowicz! - Remove trailing periods from URLs in terminal output

    URLs printed to the terminal with a sentence-ending period (e.g. https://example.com/path.) would include the period when clicked in some terminal emulators, causing 404 errors. This removes trailing periods from all URLs displayed in CLI output across wrangler, miniflare, vitest-pool-workers, and workers-utils.

  • #14150 8e7b74f Thanks @avenceslau! - Fix Workflows schedules deploy payload to match the control plane API

    When deploying a Workflow with a schedules binding property, Wrangler sent the cron expressions as a list of strings. The Workflows API expects a list of objects of the form { cron: string }, so the request was rejected. Wrangler now maps each configured cron expression to { cron } (normalizing a single string or an array) when building the request. The user-facing config still accepts a string or an array of strings.

  • #14084 e86489a Thanks @dario-piotrowicz! - Fix JSON variable bindings in wrangler init --from-dash and remote config diff

    When fetching a remote Worker's configuration, JSON variable bindings (e.g. {"my_value": 5}) were incorrectly serialized as { "name": "MY_JSON", "json": {"my_value": 5} } instead of { "MY_JSON": {"my_value": 5} }. This affected two areas:

    • wrangler init --from-dash would generate a wrangler.json with broken vars entries
    • Remote config diff checks would always report JSON bindings as changed, since the malformed remote representation could never match the local config

    Both issues are now fixed and remote JSON bindings are now correctly mapped.

  • #14155 42288d4 Thanks @dario-piotrowicz! - Include agent skill installation status in all telemetry events

    The agent skill installation status is now consistently included in all telemetry events, not just a subset of them.

  • #14063 65b5f9e Thanks @emily-shen! - Move fetch helpers into @cloudflare/workers-utils

    Shared Cloudflare API fetch helper types and plumbing now live in @cloudflare/workers-utils so Wrangler and other clients can use the same implementation.

  • #14112 3a746ac Thanks @penalosa! - Pin non-bundled runtime dependencies to exact versions

    Dependencies that are not bundled into a package's published output are installed directly into consumers' dependency trees, so they are now pinned to exact versions instead of semver ranges. This closes a supply-chain gap where an unpinned external dependency could resolve to a compromised upstream release on a fresh install. A new pnpm check:pinned-deps lint enforces this for all published packages (and for the shared pnpm catalog) going forward.

  • #14124 64ef9fd Thanks @odiak! - Fix wrangler secret bulk dropping newlines from .env input read from stdin

    Previously, .env input piped through stdin was concatenated without line breaks, so only the first secret could be parsed correctly. Stdin input now preserves line separators before parsing.

  • Updated dependencies [e06cbb7, 4ef790b, 337e912, 3a746ac]:

4.96.0

Minor Changes

  • #14087 e3c862a Thanks @edmundhung! - Add support for the new web_search binding kind.

    Cloudflare Web Search is a managed, zero-setup web discovery primitive for agents and Workers. Declare the binding as a single object in wrangler.jsonc:

    {
      "web_search": { "binding": "WEBSEARCH" }
    }
    

    There is exactly one shared web corpus, so there is no namespace, instance, or other field to specify -- only the variable name. The binding exposes a single search() method that returns URLs and catalog metadata for a query. Web Search is discovery-only -- to read a result's content the caller invokes the global fetch() API against the result's url.

    The binding is always remote in local development: Miniflare proxies to the production Web Search service via the remote-bindings transport. Adds the websearch.run OAuth scope to wrangler login.

    Also adds a wrangler websearch search command for running ad-hoc queries from the CLI:

    npx wrangler websearch search "cloudflare workers"
    npx wrangler websearch search "cloudflare workers" --limit 5
    npx wrangler websearch search "cloudflare workers" --json
    

    --limit is optional (defaults to 10, capped at 20). --json prints the raw response; without it the results render as a pretty table.

  • #13610 cbb39bd Thanks @petebacondarwin! - Add support for agent_memory bindings

    Agent Memory bindings allow Workers to connect to Cloudflare's Agent Memory service for storing and retrieving agent conversation state. This binding is remote-only, meaning it always connects to the Cloudflare API during wrangler dev rather than using a local simulation.

    To configure an agent_memory binding, add the following to your wrangler.json:

    {
      "agent_memory": [
        {
          "binding": "MY_MEMORY",
          "namespace": "my-namespace"
        }
      ]
    }
    

    Wrangler will automatically provision the namespace during deployment if it does not already exist. Type generation via wrangler types is also supported.

    This change also adds the agent-memory:write OAuth scope to Wrangler's default login scopes, so wrangler login can request the permissions needed to provision and manage Agent Memory namespaces.

  • #13610 cbb39bd Thanks @petebacondarwin! - Add wrangler agent-memory namespace commands

    The following commands have been added for managing Agent Memory namespaces:

    wrangler agent-memory namespace create <namespace>
    wrangler agent-memory namespace list [--json]
    wrangler agent-memory namespace get <namespace_name> [--json]
    wrangler agent-memory namespace delete <namespace_name> [--force]
    
  • #14087 e3c862a Thanks @edmundhung! - Add confirmation prompt to wrangler containers images delete

    Previously, running wrangler containers images delete IMAGE:TAG would delete the image immediately with no confirmation. The command now prompts for confirmation before deleting. Use -y or --skip-confirmation to bypass the prompt in non-interactive or scripted environments.

  • #14087 e3c862a Thanks @edmundhung! - Rename pipeline field to stream in pipeline bindings configuration

    The pipeline field inside pipelines bindings has been renamed to stream to align with the updated API wire format. The old pipeline field is still accepted but deprecated and will emit a warning.

    Before:

    // wrangler.json
    {
      "pipelines": [
        {
          "binding": "MY_PIPELINE",
          "pipeline": "my-stream-name"
        }
      ]
    }
    

    After:

    // wrangler.json
    {
      "pipelines": [
        {
          "binding": "MY_PIPELINE",
          "stream": "my-stream-name"
        }
      ]
    }
    
  • #14087 e3c862a Thanks @edmundhung! - Allow pipeline, stream, and sink commands to resolve resources by name with pagination-aware lookups.

  • #14087 e3c862a Thanks @edmundhung! - Support deleting secrets via wrangler secret bulk

    You can now delete secrets in bulk by setting their value to null in the JSON input file:

    { "SECRET_TO_DELETE": null, "SECRET_TO_UPDATE": "new-value" }
    
  • #14091 4c0da7b Thanks @gpanders! - Add ProxyCommand support for wrangler containers ssh

    wrangler containers ssh now automatically switches to a stdio proxy when invoked by OpenSSH's ProxyCommand, and --stdio can force this mode. This lets users connect with ssh <instance_id> when their SSH config uses Wrangler as the proxy command.

  • #13892 13cbadb Thanks @penalosa! - Remove the deprecated experimental.testMode option from unstable_dev

    experimental.testMode previously only affected the default logLevel (warn when testMode: true, log otherwise) and has been flagged for removal in its type-definition comment since it landed. It is now removed, and unstable_dev's default log level matches wrangler dev's (log).

    Callers that explicitly passed testMode: true to get quieter logs should now set logLevel: "warn" directly.

Patch Changes

  • #14016 408432a Thanks @petebacondarwin! - report all failing triggers from a single deploy

    wrangler deploy deploys several kinds of trigger in parallel (routes, custom domains, schedules, queue producers/consumers, workflows). Previously, if one of those API calls failed, the first rejection short-circuited the rest, no other deployments were reported, and (in the case of custom-domain confirmation conflicts) some failures were silently logged to stdout without the deploy actually failing.

    wrangler deploy now waits for every trigger deployment to settle, prints every successfully-deployed target (so you still see what landed), and then throws a single error listing every trigger that failed.

    Note that this also turns the previously-silent "user declined to override a conflicting Custom Domain" case into a hard failure of wrangler deploy, which matches what was always implied by the message ("Publishing to Custom Domain ... was skipped, fix conflict and try again").

  • #14125 1103c07 Thanks @dario-piotrowicz! - Bump rosie-skills from 0.7.6 to 0.8.1 and bundle it into the Wrangler output

    The new version of rosie-skills is a pure-TypeScript rewrite that removes the previously necessary ~600kb WASM binary. The package now ships only JavaScript with one minimal dependencies (modern-tar).

    Additionally, rosie-skills is now bundled directly into Wrangler's distributable rather than kept as an external runtime dependency. This eliminates the supply chain concern raised in #14110: there is no separate package to resolve at install time, since all code is inlined into Wrangler's build output.

  • #14135 5b5cbd3 Thanks @Refaerds! - Update the generated type for browser bindings to BrowserRun

    When running wrangler types, browser bindings were previously typed as the generic Fetcher. They now generate the more specific and accurate BrowserRun type.

  • #14087 e3c862a Thanks @edmundhung! - Bump rosie-skills package from 0.6.3 to 0.7.6

  • #14087 e3c862a Thanks @edmundhung! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260526.1 1.20260527.1
  • #14076 97d7d81 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260527.1 1.20260528.1
  • #14100 c647ccc Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260528.1 1.20260529.1
  • #14087 e3c862a Thanks @edmundhung! - Disable Sentry error reporting by default

    WRANGLER_SEND_ERROR_REPORTS now defaults to false instead of prompting on every error. The current prompt produces too many false-positive reports. Users can still opt in explicitly by setting WRANGLER_SEND_ERROR_REPORTS=true.

  • #14087 e3c862a Thanks @edmundhung! - Fix wrangler setup failing for Vite projects without a config file

    wrangler setup (and wrangler deploy --experimental-autoconfig) crashed with "Could not find Vite config file to modify" for Vite projects that don't have a vite.config.js or vite.config.ts. This affected 6 of the 16 create-vite templates: vanilla, vanilla-ts, react-swc, react-swc-ts, lit, and lit-ts.

    Autoconfig now creates a minimal Vite config with the Cloudflare plugin when no config file exists, instead of failing. The file extension (.ts or .js) is chosen based on whether the project has a tsconfig.json.

  • #14087 e3c862a Thanks @edmundhung! - Show helpful message with URL when browser cannot be opened in headless/container environments

    Previously, running wrangler login (or any command that opens a browser) in headless Linux environments without xdg-open installed would crash with a confusing "A file or directory could not be found — Missing file or directory: xdg-open" error.

    Now wrangler catches the error and prints a clear warning with the URL so users can copy-paste it into a browser manually.

  • #14087 e3c862a Thanks @edmundhung! - wrangler secrets-store secret create and secret update now reject secret values larger than 64 KiB (65,536 bytes) with a clear error before calling the Cloudflare API. Previously the CLI accepted them, the secret appeared in secret list, and the failure surfaced later (and confusingly) at worker deploy time as a "secret doesn't exist" error against the binding. 64 KiB is the cap enforced by the API; the CLI now enforces it at the same boundary.

  • #14059 b64b7e4 Thanks @matingathani! - Fix wrangler kv bulk get printing "Success!" to stdout, which corrupted JSON output when piped to tools like jq

  • #14002 e4c8fd9 Thanks @danyalahmed1995! - Show a clear error for invalid API token header characters

    Wrangler now detects API tokens containing characters that cannot be sent in the HTTP Authorization header before making an API request. This avoids a low-level ByteString conversion error and helps users recreate or recopy the token without printing the token value.

  • #14132 2dffeeb Thanks @dario-piotrowicz! - Adapt React Router autoconfig based on v8_middleware future flag

    The React Router autoconfig (wrangler setup) now detects whether v8_middleware: true is set in the user's react-router.config.ts. When it is, the generated workers/app.ts uses a simplified fetch handler without AppLoadContext module augmentation, and the generated app/entry.server.tsx omits the _loadContext parameter. When v8_middleware is not set, the existing AppLoadContext pattern with env/ctx params is preserved.

    This avoids breaking projects that use the v8_middleware future flag (which changes the context API from AppLoadContext to RouterContextProvider), while keeping the traditional pattern for projects that haven't opted in.

  • #14133 59e43e4 Thanks @matingathani! - Fix wrangler whoami printing a trailing period after the api-tokens URL

    The message To see token permissions visit https://...api-tokens. ended with a period that became part of the URL when clicked in terminals or GitHub Actions output, causing a 404. The period is removed and a comma added before "visit" so the sentence reads naturally without a trailing period on the URL.

  • Updated dependencies [e3c862a, cbb39bd, 7bb5c7a, e3c862a, 97d7d81, c647ccc, e3c862a, e3c862a, 972d13d]:

4.95.0

Minor Changes

  • #14009 ca5b604 Thanks @dario-piotrowicz! - Add telemetry for detecting whether AI coding agents have Cloudflare skills installed

    Wrangler now includes a currentAgentSkillsInstalled property in telemetry events that reports whether the current AI coding agent has Cloudflare skills present on disk. The value distinguishes between skills installed automatically by Wrangler ("automatic"), skills installed manually by the user ("manual"), no skills present (false), or no supported agent detected (null). Skill names are fetched from the GitHub Contents API with a 24-hour disk cache to avoid rate limits.

  • #14014 d042705 Thanks @emily-shen! - Add --x-deploy-helpers to gate an upcoming deploy path refactor.

Patch Changes

  • #14003 c1fd2fd Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260521.1 1.20260526.1
  • #13728 49c1a59 Thanks @penalosa! - Reject remote: false on always-remote bindings (AI, AI Search, Media, Artifacts, Flagship, VPC Service, VPC Network)

    These binding types have no local simulator and the resource is fundamentally remote-only. Setting remote: false was previously silently accepted but produced a non-functional binding. wrangler dev now fails with a clear error directing users to either remove the remote field or set it to true.

  • #14039 fee1ce4 Thanks @dario-piotrowicz! - Preserve --compatibility-flags in the interactive deploy config flow

    When running wrangler deploy without a config file and going through the interactive setup flow, any --compatibility-flags passed on the command line (e.g. --compatibility-flags=nodejs_compat) were lost in two places:

    1. The generated wrangler.jsonc file did not include compatibility_flags.
    2. The suggested CLI command shown when declining the config file write did not include --compatibility-flags.

    Both are now fixed. Compatibility flags are persisted to the generated config and included in the suggested command.

  • #14010 b3962ff Thanks @dario-piotrowicz! - Improve error messages for Pages CLI commands

    Error messages across wrangler pages subcommands (deploy, dev, secret, project, etc.) now provide clearer descriptions and actionable guidance. For example, instead of "Must specify a project name.", you'll now see "Missing Pages project name. Use --project-name or set the name in your wrangler.jsonc configuration file."

  • #14011 420e457 Thanks @petebacondarwin! - Warn when a remote-bindings request is blocked by Cloudflare Access

    When wrangler dev is used with remote bindings and a request from the local remote-bindings proxy client to the remote workers.dev proxy server is blocked by Cloudflare Access (HTTP 403 with the Cloudflare Access block page), Wrangler now:

    • Logs a single, visually striking warning per dev session explaining how to set CLOUDFLARE_ACCESS_CLIENT_ID / CLOUDFLARE_ACCESS_CLIENT_SECRET (Service Token credentials) or run cloudflared access login to authenticate.
    • Replaces the original Access HTML block page with a readable plain-text body containing the same guidance, so the message also reaches the user via binding error messages (e.g. InferenceUpstreamError from env.AI.run()) and any browser response piped back via a service binding .fetch().

    Previously the 403 was returned to user code with the full Access HTML, which both drowned out other logs and made it hard to tell that the failure was due to Cloudflare Access on workers.dev rather than a problem in the binding itself or the deployed proxy server. The detection runs inside the proxy client worker (which only ever talks to the remote-bindings proxy URL), so it does not trigger false positives on user-worker 403s.

  • #14044 8b1467e Thanks @pombosilva! - Rename Workflow binding schedule property to schedules

    The schedule property on Workflow bindings introduced in #13467 has been renamed to schedules to match the control plane API.

    Note: This remains a configuration-only change. Scheduled triggering of Workflow instances is not yet available — adding schedules to a Workflow binding will not result in scheduled invocations at this time.

  • Updated dependencies [c1fd2fd, 420e457]:

4.94.0

Minor Changes

  • #13897 52e9082 Thanks @dario-piotrowicz! - Add automatic Cloudflare skills installation for AI coding agents

    Wrangler now detects AI coding agents and offers to install Cloudflare skill files from the cloudflare/skills GitHub repository. Users are prompted once interactively; subsequent runs skip the prompt. Use --install-skills to install without prompting.

  • #13989 f598eac Thanks @MattieTK! - Print a QR code alongside the tunnel URL when sharing via Cloudflare Tunnel

    When a tunnel is started (via wrangler dev --tunnel or the Vite plugin with tunnel: true), a scannable QR code is now printed to the terminal beneath the tunnel URL. This makes it easy to open the tunnel on a mobile device without manually copying the URL.

    The QR code uses Unicode block characters for a compact representation and is generated best-effort -- if generation fails for any reason, the tunnel URL is still displayed as before.

  • #13467 3a1fbed Thanks @deloreyj! - Add schedule property to Workflow bindings for cron-based triggering

    Note: This is a configuration-only change. Scheduled triggering of Workflow instances is not yet available — adding schedule to a Workflow binding will not result in scheduled invocations at this time. This change lays the groundwork for an upcoming feature.

    Workflow bindings in wrangler.json now accept an optional schedule field that configures one or more cron expressions to automatically trigger new workflow instances on a schedule.

    // wrangler.json
    {
      "workflows": [
        {
          "binding": "MY_WORKFLOW",
          "name": "my-workflow",
          "class_name": "MyWorkflow",
          "schedule": "0 9 * * 1"
        }
      ]
    }
    

    Multiple schedules can be provided as an array:

    {
      "workflows": [
        {
          "binding": "MY_WORKFLOW",
          "name": "my-workflow",
          "class_name": "MyWorkflow",
          "schedule": ["0 9 * * 1", "0 17 * * 5"]
        }
      ]
    }
    

    The schedule is sent to the Workflows control plane on wrangler deploy. Configuring schedule on a workflow binding that references an external script_name is an error — the schedule must be configured on the worker that defines the workflow.

Patch Changes

  • #13993 0733688 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260520.1 1.20260521.1
  • #14008 fc1f7b9 Thanks @petebacondarwin! - Fix Access Service Token authentication for applications that only allow service tokens

    When using remote bindings against a Worker behind a Cloudflare Access application configured to only allow Service Auth tokens (no interactive user authentication), Wrangler previously ignored the CLOUDFLARE_ACCESS_CLIENT_ID and CLOUDFLARE_ACCESS_CLIENT_SECRET environment variables and the request would fail with a 403.

    This happened because Wrangler detects Access by looking for a 302 redirect to cloudflareaccess.com. A service-auth-only Access application has no interactive login path, so it responds with a hard 403 instead of redirecting. Wrangler concluded the domain was not behind Access and skipped attaching the service token headers entirely.

    The env-var check now runs before the Access detection step, so the configured service token credentials are always used when present.

  • #12277 8c569c6 Thanks @penalosa! - Include column names in D1 SQL export INSERT statements

    D1 SQL exports now include column names in INSERT statements (e.g., INSERT INTO "table" ("col1","col2") VALUES(...)). This ensures that exported SQL can be successfully imported even when the target table has columns in a different order than the original, which commonly occurs during iterative development when schemas evolve.

  • Updated dependencies [0733688, 30657e1]:

4.93.1

Patch Changes

  • #13978 fa1f61f Thanks @sassyconsultingllc! - Bump ws from 8.18.0 to 8.20.1 to address GHSA-58qx-3vcg-4xpx

    GHSA-58qx-3vcg-4xpx / CVE-2026-45736 reports an uninitialized-memory disclosure in ws@<8.20.1 when a TypedArray is passed as the reason argument to WebSocket.close(). The fix shipped in ws@8.20.1 on 2026-05-12. This change bumps the workspace catalog entry so that miniflare, wrangler, and @cloudflare/vite-plugin all pick up the patched release.

  • #13977 2679e05 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260518.1 1.20260519.1
  • #13984 7e40d98 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260519.1 1.20260520.1
  • #13963 adc9221 Thanks @gabivlj! - Preserve sibling container image tags during local dev cleanup

    Wrangler now keeps other cloudflare-dev image tags from the same dev session when multiple containers share a Dockerfile. Previously, duplicate-image cleanup could remove earlier container tags if Docker BuildKit produced the same image ID for each build.

  • #13839 735852d Thanks @matingathani! - fix: show actionable hint when /memberships returns a bad-credentials error (code 9106)

    Previously, wrangler threw a raw Cloudflare API error ("Missing X-Auth-Key, X-Auth-Email or Authorization headers") with no guidance. Now it emits a UserError explaining that an environment variable such as CLOUDFLARE_API_TOKEN, CLOUDFLARE_API_KEY, or CLOUDFLARE_EMAIL may be set to an invalid value, and suggests running wrangler logout / wrangler login to re-authenticate.

  • #13912 d803737 Thanks @petebacondarwin! - Fix /cdn-cgi/* host validation incorrectly accepting subdomains of exact configured routes

    Miniflare's /cdn-cgi/* host/origin validator was treating exact configured routes the same as wildcard configured routes, so a request whose Host or Origin hostname was a subdomain of an exact route (e.g. sub.my-custom-site.com for a my-custom-site.com/* route) was incorrectly accepted. Exact configured routes and the configured upstream hostname are now required to match the request hostname exactly. Subdomain matching is only applied to wildcard routes such as *.example.com/*. Localhost hostnames continue to be allowed as before.

    This affects wrangler dev and local development through @cloudflare/vite-plugin, both of which use Miniflare under the hood.

  • #13919 c7eab7f Thanks @petebacondarwin! - Fix the outbound CF-Worker header reflecting the route pattern hostname instead of the parent zone, and falling back to <worker-name>.example.com under vite dev, vitest-pool-workers, and getPlatformProxy

    Two related issues affected the CF-Worker header on outbound subrequests in local development:

    1. Under @cloudflare/vite-plugin, @cloudflare/vitest-pool-workers, and getPlatformProxy, the header fell back to <worker-name>.example.com even when routes were configured, because unstable_getMiniflareWorkerOptions and the equivalent getPlatformProxy worker-options path did not propagate a zone value to Miniflare. This broke local development against services that reject unknown CF-Worker hosts (for example, Apple WeatherKit returns 403 Forbidden).
    2. Across the above paths and wrangler dev --local, when a route used the zone_name field (for example { pattern: "foo.example.com/*", zone_name: "example.com" }), the header was set to the pattern's hostname (foo.example.com) rather than the zone name (example.com). Production sets CF-Worker to the zone name that owns the Worker, so this was inconsistent with deployed behaviour.

    Both bugs are fixed: the new unstable_getMiniflareWorkerOptions / getPlatformProxy path now propagates a zone derived from the first configured route, and all four local-dev paths now prefer a route's explicit zone_name over the pattern hostname when computing that zone. When zone_name isn't set, the existing best-effort behaviour is preserved — for wrangler dev this means dev.host is still honoured as a local override and the pattern hostname is used as a final fallback. Resolving the parent zone for zone_id-only, custom_domain, or plain-string routes would require an API lookup, so locally we still approximate it with the pattern hostname.

    Note: dev.host is intentionally not consulted by the unstable_getMiniflareWorkerOptions / getPlatformProxy paths — the dev config block is specific to wrangler dev.

  • #13990 e04e180 Thanks @petebacondarwin! - Improve the log message shown when an asset upload attempt fails and is retried

    The retry message now reports which attempt is being made (e.g. Asset upload failed. Retrying... 1 of 5 attempts.), making it easier to gauge how close Wrangler is to exhausting its retry budget. The raw error object is no longer appended to this user-facing message; it is instead logged at debug level (visible via WRANGLER_LOG=debug).

  • #13954 62abf97 Thanks @petebacondarwin! - Read the on-disk OAuth state lazily so CLOUDFLARE_API_TOKEN from .env takes priority correctly

    Wrangler previously read its OAuth state from the user auth config file (for example ~/.config/.wrangler/config/default.toml) eagerly at module-import time. That happens before .env files are loaded, so the in-memory state would always hold the OAuth tokens even when the user only wanted to authenticate via CLOUDFLARE_API_TOKEN. If that stored OAuth token happened to be expired, Wrangler would try to refresh it (and fail), aborting the command with Failed to fetch auth token: 400 Bad Request and Not logged in. — even though a valid API token was in scope.

    Wrangler now reads the auth config file on demand, after .env has been loaded. When CLOUDFLARE_API_TOKEN (or CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL) is present, the OAuth state on disk is no longer consulted, the OAuth refresh endpoint is no longer called, and the env-based token is used directly. Sibling-process refresh-token rotation is also handled naturally because every check reads the current file contents.

    Internally, the exported reinitialiseAuthTokens() function is removed — there is no module-level OAuth cache left to invalidate.

    Fixes #13744.

  • #13951 e349fe0 Thanks @sejoker! - Enforce minimum 60 second interval for R2 Data Catalog sinks

    R2 Data Catalog sinks now require a minimum --roll-interval of 60 seconds to prevent compaction issues in the R2 Data Catalog. This validation is applied when creating sinks via wrangler pipelines sinks create with type r2-data-catalog, and during the interactive wrangler pipelines setup flow.

    Regular R2 sinks are not affected and can still use intervals as low as 10 seconds.

  • #13959 da0fa8c Thanks @dmmulroy! - Recognize Artifacts repositories that are still being created

    Wrangler's Artifacts repo status type now accepts the creating lifecycle state alongside existing in-progress statuses.

  • #13964 a5c9365 Thanks @danielrs! - Use dedicated API endpoint for wrangler secret bulk

    wrangler secret bulk now uses a more efficient, dedicated API endpoint. This reduces the operation from 2 API calls to 1 and eliminates the risk of accidentally affecting non-secret bindings.

  • Updated dependencies [fa1f61f, 2679e05, 7e40d98, d803737, 59cd880, e8c2031]:

4.93.0

Minor Changes

  • #13901 aac7ca0 Thanks @bghira! - Add wrangler ai models schema command for fetching model schemas

    You can now run wrangler ai models schema <model> to fetch the input and output schema for a Workers AI model from the public model catalog schema endpoint.

  • #12656 ae047ee Thanks @mikenomitch! - Add --containers-rollout=none

    This allows you to skip deploying a container. This is useful if you know that your container is not going to be updated or you don't have Docker locally, but still want to make changes to your Worker.

  • #13901 aac7ca0 Thanks @bghira! - Add wrangler ai models list command for querying the Workers AI model catalog

    wrangler ai models list accepts --search, --task, --author, --source, and --hide-experimental, matching the public model catalog search endpoint.

Patch Changes

  • #13948 b25dc0d Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260515.1 1.20260518.1
  • #13882 a4f22bc Thanks @matingathani! - Throw a clear error when a D1 migration is cancelled instead of silently returning

  • #13950 f78d435 Thanks @dario-piotrowicz! - Improve the Docker CLI error message to be more actionable.

    Include a link to Docker installation docs, platform-specific instructions for starting the daemon, and guidance for alternative Docker-compatible CLIs.

  • #11896 c5c9e20 Thanks @staticpayload! - Surface remote proxy session errors

    When remote bindings fail to start, include the controller reason and root cause in the error message to make failures like missing cloudflared clearer.

  • #13932 ebf4b24 Thanks @zebp! - Fix local Workflow startup when compatibility flags include experimental

    Miniflare now deduplicates compatibility flags for the internal Workflow engine service. This prevents wrangler dev from failing with Compatibility flag specified multiple times: experimental when the user's Worker already enables that flag.

  • #13929 895baf5 Thanks @Caio-Nogueira! - Prompt to provision a workers.dev subdomain before deploying Workflows

    Wrangler now checks for the account-level workers.dev subdomain when deploying Workflows, even if the Worker is not being published to workers.dev. If the subdomain has not been registered yet, Wrangler prompts to create one before calling the Workflows deploy API so users avoid an opaque server-side deployment failure.

  • #13930 7bcdf45 Thanks @shiminshen! - Sweep stale .wrangler/tmp/* dirs left behind by abnormal exits

    A wrangler dev session creates .wrangler/tmp/bundle-* and .wrangler/tmp/dev-* directories at startup and removes them via a signal-exit hook on graceful shutdown. When the process exited abnormally (SIGKILL, OOM, host crash) those directories were left behind and accumulated across sessions, slowing down dependency-walking tools that follow the bundle-emitted absolute-path imports.

    wrangler now sweeps entries in .wrangler/tmp/ older than 24 hours when a new temporary directory is requested, bounding the leak regardless of how prior sessions exited.

  • Updated dependencies [b25dc0d, ebf4b24, b27eb18]:

4.92.0

Minor Changes

  • #13670 506aa02 Thanks @elithrar! - Add wrangler artifacts commands for managing Artifacts repos and repo tokens.

    This adds CLI support for the Artifacts control-plane workflows that were previously only available through the API. You can now list and inspect namespaces, create, list, inspect, and delete repos, and issue repo-scoped tokens when you need to authenticate git access.

    The new commands support both human-readable output and --json output so they fit existing Wrangler automation patterns.

  • #13916 be8a98c Thanks @emily-shen! - Add --keep-vars flag to wrangler versions upload, matching the existing behavior in wrangler deploy. When set, environment variables configured via the dashboard are preserved rather than being deleted before the upload.

Patch Changes

  • #13926 19ed49a Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260511.1 1.20260515.1
  • #11471 3ff0a50 Thanks @HW13! - Improve wrangler types --env-interface for multi-worker projects.

    Custom env interfaces generated by wrangler types no longer expand from Cloudflare.Env, avoiding some unintended type expansion when multiple workers' generated types are used together.

  • #13910 bf688f7 Thanks @timoconnellaus! - Fix Failed to fetch auth token: 401 Unauthorized from sibling-rotated refresh tokens

    refreshToken previously used the refresh token from module-level localState, which is populated once at startup and never re-read. OAuth refresh tokens are single-use, so when a sibling wrangler process (in another repo, another shell, or a parallel script) refreshes first, it rotates the token server-side and writes the new value to the shared config file (~/Library/Preferences/.wrangler/config/default.toml on macOS). The long-lived process — typically wrangler dev — then sends its stale in-memory token on the next refresh and gets 401 Unauthorized from https://dash.cloudflare.com/oauth2/token, falling through to interactive login and timing out unattended.

    refreshToken now calls reinitialiseAuthTokens() before exchanging, picking up the latest refresh token written by any sibling process. The previously empty catch {} also now logs the underlying error at debug level so future refresh failures are diagnosable without source-diving.

  • #13843 2e72c83 Thanks @nzws! - Fix wrangler versions secret put/delete/bulk to preserve the existing version's placement settings

    When creating a new version via wrangler versions secret, the previous code only re-emitted a bare { mode: "smart" } placement when the API reported placement_mode === "smart", dropping any other placement entirely. The new version is now created with the placement settings returned by the API, so placement settings survive a secret put/delete/bulk round-trip.

  • #13908 802eaf4 Thanks @shiminshen! - fix: stop rewriting query strings that happen to contain the request Host

    wrangler dev previously rewrote occurrences of the outer host inside request.url's query string. For example, a request to ?echo=https%3A%2F%2Fdevelopment.test%2Fpath with Host: development.test would be seen by the user worker as ?echo=https%3A%2F%2Fproduction.test%2Fpath, silently mutating opaque application data such as redirect_uri values in OAuth flows.

    The proxy worker now sets the internal MF-Original-URL header after its blanket host-rewriting pass over request headers, so the URL passed to the user worker preserves the original query string.

  • #13827 8f5cdb1 Thanks @greyvugrin! - Fix multi-environment warning when CLOUDFLARE_ENV is set

    Commands that warn when multiple environments are configured but none is specified (e.g. wrangler deploy, wrangler secret put) were not accounting for the CLOUDFLARE_ENV environment variable when deciding whether to show the warning. This caused a misleading warning to appear even when the target environment was correctly specified via CLOUDFLARE_ENV.

  • Updated dependencies [19ed49a]:

4.91.0

Minor Changes

  • #13822 c8be316 Thanks @edmundhung! - Add named tunnel support and tunnel shortcuts to wrangler dev

    You can now use wrangler dev --tunnel --tunnel-name <name> to start a dev session with an existing named Cloudflare Tunnel, or set --tunnel-name ahead of time and start it later by pressing t to start or close the tunnel. This gives you a stable public hostname for local development instead of the temporary trycloudflare.com URL used by Quick Tunnels.

Patch Changes

  • #13848 d4794a8 Thanks @MattieTK! - Condense repeated environment configuration warnings

    Wrangler now summarises repeated missing vars and define entries in environment configuration warnings. Experimental unsafe warnings are also only emitted once when the field appears at both the top level and in the active environment.

  • #13894 58b4403 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260508.1 1.20260511.1
  • #13780 4352f87 Thanks @matingathani! - Normalize legacy instance type aliases (standardstandard-1, devlite) to prevent phantom EDIT diffs on every deploy

  • #13834 a9e6741 Thanks @matingathani! - fix: hotkeys now work with Caps Lock enabled

    Wrangler's dev server hotkeys (e.g. b to open browser and x to exit) did not respond when Caps Lock was enabled. These hotkeys now work consistently whether or not Caps Lock is on.

  • #13750 da664d5 Thanks @matingathani! - fix: automatically delete log files older than 30 days and add WRANGLER_WRITE_LOGS=false to disable disk logging

    Wrangler previously accumulated log files in ~/.wrangler/logs/ indefinitely, causing some users to accumulate gigabytes of logs over time.

    Log files older than 30 days are now automatically cleaned up on the first log write. Disk logging can be disabled entirely by setting WRANGLER_WRITE_LOGS=false.

  • #13914 bdc398c Thanks @Maximo-Guk! - preserve native shape of non-string vars in worker previews

    wrangler preview previously coerced every non-string entry in previews.vars (arrays, objects, numbers, booleans) into a plain_text binding via JSON.stringify, so at runtime the worker saw a literal string instead of the value declared in wrangler.jsonc. wrangler deploy already serializes non-string vars as json bindings so the Workers runtime parses them back into native JS values; previews now match.

    Before:

    // wrangler.jsonc — previews.vars
    { "ALLOWLIST": ["a@example.com", "b@example.com"] }
    // runtime
    typeof env.ALLOWLIST === "string" // true (was '["a@example.com","b@example.com"]')
    

    After:

    typeof env.ALLOWLIST === "object"; // Array.isArray(env.ALLOWLIST) === true
    
  • #13778 1420f10 Thanks @maxwellpeterson! - Propagate unsafe.bindings and service binding cross_account_grant to worker previews

    Worker previews now propagate unsafe.bindings declared on the previews config block to the deployment metadata, mirroring the deploy-time behavior. Without this, internal binding shapes that wrangler doesn't yet model (notably service bindings carrying cross_account_grant) were silently dropped on previews while working fine on regular deploys. The same change wires through cross_account_grant on typed services bindings.

  • Updated dependencies [58b4403, f781a2b]:

4.90.1

Patch Changes

  • #13866 4e44ce6 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260507.1 1.20260508.1
  • #13837 b0cee1d Thanks @matingathani! - Fix beta/open-beta status message ignoring printBanner: false — when a command sets printBanner: (args) => !args.json, the status banner no longer appears in JSON output

  • #13887 d878e13 Thanks @apeacock1991! - Fix wrangler dev hanging on shutdown when remote bindings are present

    startDev() registers dev hotkeys before authenticating the user. During interactive dev sessions, the auth callback re-registers hotkeys, which updates the local unregisterHotKeys variable to a new cleanup function. However, the unregisterHotKeys value returned to callers was captured as a direct reference to the initial registration, so it would call the stale cleanup function instead of the current one.

    This has been fixed by returning a wrapper function () => unregisterHotKeys?.() instead of the variable directly. The wrapper evaluates unregisterHotKeys at call time, ensuring it always invokes the latest cleanup function even after re-registration.

  • #13867 971dfe3 Thanks @petebacondarwin! - Fix race in RemoteProxySession.updateBindings so it waits for the remote worker to finish reloading with the new bindings before resolving

    Previously, updateBindings resolved as soon as the config update event was dispatched, long before the remote worker had been re-uploaded and the local proxy worker had unpaused. Callers that issued requests immediately afterwards could see flaky failures — typically "WebSocket connection failed" for JSRPC bindings such as service bindings or dispatch namespaces — because the local proxy worker was still in its paused state during the reload window. updateBindings now waits for the next reloadComplete event and for the local proxy worker's runtime-message queue to drain before returning, so callers can safely issue requests after await session.updateBindings(...). If the reload fails, the rejection from updateBindings carries the underlying error.

  • #13867 971dfe3 Thanks @petebacondarwin! - Fix unhandled AbortError from wrangler dev's remote tail WebSocket when the bundle rebuilds or the dev session shuts down

    The remote-runtime tail-logs WebSocket (#activeTail in RemoteRuntimeController) was constructed with the same AbortSignal that onBundleStart aborts to cancel in-flight preview-session operations. The abort destroyed the WebSocket's underlying upgrade request with AbortError, which had no error listener attached and propagated as an unhandled exception. We now attach an error listener at WebSocket construction that ignores errors (logging at debug level), matching the safeguards already present on the terminate paths in #previewToken and teardown().

  • Updated dependencies [4e44ce6, 5d936c5]:

4.90.0

Minor Changes

  • #12279 248bc08 Thanks @penalosa! - Add deprecation warning for delivery_delay in queue producer bindings

    The delivery_delay setting in [[queues.producers]] was silently having no effect since 2024. This change adds a deprecation warning when the setting is used, informing users that queue-level settings should be configured using wrangler queues update instead. The setting will be removed in a future version.

Patch Changes

  • #13853 8852b0c Thanks @gpanders! - Fix Containers SSH config

  • #13858 e414e56 Thanks @penalosa! - Fix wrangler whoami and account selection failing for Account API Tokens

    The /memberships fallback for Account API Tokens was checking for code 9109, but /memberships actually returns 9106 for that case. Correct the code so the fallback to /accounts triggers as intended.

  • Updated dependencies []:

4.89.1

Patch Changes

  • #13824 dd3baf3 Thanks @emily-shen! - Fix container deployment being skipped for Workers for Platforms user workers

    Previously, deploying a worker with --dispatch-namespace would early-exit before calling deployContainers(), meaning container-app registration that links the image to the Durable Object namespace was never executed for WfP user workers. Container deployment now runs before the WfP early exit.

  • Updated dependencies [5cf6f81]:

4.89.0

Minor Changes

  • #13055 f3fed88 Thanks @GregBrimble! - Introducing the cache configuration option for Workers.

    You can now set { cache: { enabled: true } } in your Wrangler configuration file to enable a HTTP cache in front of your Worker's fetch handler. This is also supported in [previews] configuration — previews.cache overrides the top-level cache setting for preview deployments, and falls back to the top-level value when absent. More information can be found in our documentation.

  • #13776 1a54ac5 Thanks @petebacondarwin! - wrangler dev and other Miniflare-backed commands now run the local workerd runtime with TZ=UTC to match production

    Previously, wrangler dev (and other commands that spin up Miniflare, such as wrangler kv, wrangler d1, wrangler r2, wrangler check) inherited the host machine's timezone, so Date and Intl APIs inside a Worker observed the developer's local timezone during local development but UTC in production. This caused subtle, hard-to-debug differences between local and deployed behaviour.

    Local development now matches production. Code that previously relied on the host timezone during wrangler dev will need to either accept UTC (the production behaviour) or explicitly construct dates/formatters with the desired timezone.

Patch Changes

  • #13829 2284f20 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260504.1 1.20260506.1
  • #13841 332f527 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260506.1 1.20260507.1
  • #13777 18e833d Thanks @matingathani! - fix: throw a clear error when _routes.json contains invalid JSON instead of silently skipping it

  • #13751 b6cea17 Thanks @matingathani! - fix: ensure wrangler types --check --env-file does not falsely report stale types when .dev.vars exists

  • #13775 53e846a Thanks @maxwellpeterson! - Fix wrangler preview not propagating the assets binding to preview deployments

    Previously, wrangler preview would upload the asset manifest correctly but the resulting preview deployment had no ASSETS binding (or whatever name was configured under assets.binding). Workers reading from the binding would see undefined and fail at runtime.

    The fix emits the assets binding into the deployment's env map alongside other bindings, mirroring wrangler deploy.

  • #13770 beff19c Thanks @petebacondarwin! - Only show accounts available for the current login auth in wrangler whoami and the interactive account picker

    Wrangler now lists the intersection of /accounts and /memberships instead of either endpoint alone, dropping accounts the active OAuth token or API token has no membership in. The accounts field of wrangler whoami --json is filtered the same way. When /memberships is inaccessible to the current auth (e.g. Account API Tokens) Wrangler falls back to /accounts so those tokens continue to work as before.

  • #13832 af42fed Thanks @gpanders! - Show containers ssh in wrangler containers --help and in wrangler containers ssh --help

    The containers ssh command was previously hidden, so it did not appear in the list of subcommands shown by wrangler containers --help, and its description was omitted from wrangler containers ssh --help. The command is now listed with its description in both places.

  • Updated dependencies [2284f20, 332f527, 039bada, 1a54ac5]:

4.88.0

Minor Changes

  • #13760 e07825a Thanks @danielgek! - Add builtin storage option to wrangler ai-search create.

    wrangler ai-search create now supports a third storage type, builtin, in addition to r2 and web-crawler. When --type builtin is selected (or chosen interactively), Wrangler creates the instance using Cloudflare-managed storage by omitting type and source from the API request — the API treats an absent type as builtin storage. Builtin instances do not accept --source, --prefix, --include-items, or --exclude-items.

  • #13721 58899d8 Thanks @danielgek! - Add optional custom_metadata step to wrangler ai-search create

    The wrangler ai-search create interactive wizard now lets you declare custom metadata fields that the new AI Search instance should index. Each field is a field_name paired with a data_type (text, number, boolean, or datetime).

    You can provide fields up-front via the new repeatable --custom-metadata flag using field_name:data_type syntax:

    wrangler ai-search create my-instance \
      --type r2 --source my-bucket \
      --custom-metadata title:text \
      --custom-metadata views:number
    

    For larger schemas, use --custom-metadata-schema to point at a JSON file containing an array of { field_name, data_type } objects:

    wrangler ai-search create my-instance \
      --type r2 --source my-bucket \
      --custom-metadata-schema schema.json
    
    [
      { "field_name": "title", "data_type": "text" },
      { "field_name": "views", "data_type": "number" }
    ]
    
  • #13701 18b9d5b Thanks @dario-piotrowicz! - Prompt for missing name and compatibility date interactively during wrangler deploy

    When deploying without a project name or compatibility_date in your configuration or CLI arguments, wrangler deploy now interactively prompts for the missing values instead of immediately failing with an error. For compatibility date, the prompt offers to use today's date; if you decline, the existing error is shown. The compatibility date prompt is skipped when --latest is passed. In non-interactive or CI environments, behavior is unchanged.

    Additionally, when no config file exists, wrangler deploy now offers to save the prompted name and compatibility date to a wrangler.jsonc file for future use. This interactive flow is available for all wrangler deploy invocations — not just asset-only deployments.

  • #13810 2b8c0cc Thanks @jamesopstad! - Stabilize the secrets configuration property

    The secrets property in the Wrangler config file is no longer experimental and will no longer emit an experimental warning when used. Required secrets are validated during local development and deploy, and used as the source of truth for type generation.

    {
      "secrets": {
        "required": ["API_KEY", "DB_PASSWORD"]
      }
    }
    

Patch Changes

  • #13765 3020214 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260430.1 1.20260501.1
  • #13800 0099265 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260501.1 1.20260504.1
  • #13812 25f5ef2 Thanks @emily-shen! - fix: --alias CLI flag now works in wrangler deploy

    The --alias flag was accepted but silently ignored during wrangler deploy — only config.alias took effect. We now collect aliases from both config and CLI flags.

  • #13772 194d75e Thanks @zakcutner! - Fix wrangler types to generate Fetcher for unsafe.bindings entries with type: "service"

    Previously, all entries in unsafe.bindings (other than ratelimit) generated a fallback any type. wrangler types now generates Fetcher for unsafe bindings declared with type: "service", matching the type used for regular service bindings.

  • #13818 9f532f7 Thanks @1000hz! - Support Flagship bindings in Worker Previews

    wrangler preview now accepts flagship entries in the previews block and includes them in Preview deployment bindings. This lets Workers that use Flagship bindings deploy Preview versions with preview-specific Flagship app IDs.

  • #12974 1127114 Thanks @ask-bonk! - Fix props and fetcher-type service bindings being dropped in unstable_getMiniflareWorkerOptions

    The post-processing in unstable_getMiniflareWorkerOptions was rebuilding serviceBindings from scratch, which silently dropped props on service bindings and dropped fetcher-type bindings entirely. It was also re-deriving durableObjects identically to what buildMiniflareBindingOptions already produces. Both have been removed; buildMiniflareBindingOptions now produces the final bindings unchanged.

  • #13739 3ceadef Thanks @edmundhung! - Skip confirmation prompts in wrangler versions deploy when versions are provided as CLI arguments

    Passing version IDs or version specs to wrangler versions deploy now applies those values directly instead of opening interactive prompts to confirm the same versions and percentages. This makes the command easier to automate without requiring --yes.

  • #13745 1a5cc86 Thanks @edmundhung! - fix: preserve request ports in Origin and Referer headers when using wrangler dev --host

  • Updated dependencies [3020214, 0099265, bb27219, 12fb5db]:

4.87.0

Minor Changes

  • #13726 b5ac54b Thanks @penalosa! - Hard fail on Node.js < 22

    Wrangler no longer supports Node.js 20.x, as it reached end-of-life on 2026-04-30. The minimum supported Node.js version is now 22.0.0. See https://github.com/nodejs/release?tab=readme-ov-file#end-of-life-releases.

  • #13717 9a1f014 Thanks @NuroDev! - Add an experimental experimental_generateTypes() programmatic API.

    Wrangler now exposes experimental_generateTypes() from the package root so you can generate Worker types in code using the same logic as wrangler types. The API supports the same core type-generation options (include env/runtime toggles) and returns structured output with separate env and runtime content alongside the combined formatted output.

Patch Changes

  • #13732 22e1a61 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260426.1 1.20260429.1
  • #13754 00523c8 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260429.1 1.20260430.1
  • #13711 1c4d850 Thanks @dario-piotrowicz! - fix: skip auto-config and OpenNext delegation when --config is explicitly provided

    When --config is passed to wrangler deploy, the user is explicitly targeting a specific Worker configuration. Previously, wrangler would ignore --config and delegate to opennextjs-cloudflare deploy if it detected an OpenNext project in the working directory, silently deploying the wrong Worker. Now, both auto-config detection and OpenNext delegation are skipped when --config is provided, matching the existing behavior for --script and --assets.

  • #13735 6d28037 Thanks @edmundhung! - Improve config-schema.json hover text in more editors

    Wrangler now emits markdownDescription in config-schema.json alongside the existing description field. Editors that support rich JSON Schema hovers can use that markdown directly instead of rendering escaped links and formatting.

  • #13722 0827815 Thanks @MattieTK! - Improve safe telemetry categorisation for user-facing Wrangler errors.

  • #13116 e539008 Thanks @dario-piotrowicz! - Allow getPlatformProxy and unstable_getMiniflareWorkerOptions to start when the assets directory does not exist yet

    Previously, getPlatformProxy would catch and swallow NonExistentAssetsDirError internally when the configured assets directory was absent on disk. This has been refactored so that the directory-existence check is skipped entirely for getPlatformProxy and unstable_getMiniflareWorkerOptions, since these APIs are typically used at dev time in frameworks where the assets directory is a build output that may not exist yet.

    wrangler dev, wrangler deploy, wrangler versions upload, and wrangler triggers deploy continue to require the assets directory to exist when specified.

  • Updated dependencies [22e1a61, 00523c8, b5ac54b, e653edf, e1eff94, e539008, 0bf64a7, b04eedf, 6457fb3, c07d0cb]:

4.86.0

Minor Changes

  • #13605 ea943ff Thanks @danielgek! - Add namespace support to wrangler ai-search commands

    All wrangler ai-search instance commands (create, list, get, update, delete, stats, search) now accept a --namespace (or -n) flag to target a specific AI Search namespace. When the flag is omitted, commands default to the default namespace that Cloudflare automatically provisions for every account.

    wrangler ai-search list now displays a namespace column, and wrangler ai-search create offers an interactive picker for existing namespaces (with an option to create a new one) when --namespace is not supplied in an interactive session.

    A new wrangler ai-search namespace subcommand group is also introduced, with list, create, get, update, and delete subcommands for managing namespaces directly.

    wrangler ai-search list --namespace blog
    wrangler ai-search create my-instance --namespace blog --type r2 --source my-bucket
    wrangler ai-search namespace create blog --description "Blog content"
    
  • #13637 9eb9e69 Thanks @edmundhung! - Add --tunnel flag to wrangler dev for sharing your local dev server via Cloudflare Quick Tunnels

    You can now expose your local dev server publicly by passing --tunnel:

    wrangler dev --tunnel
    

    This starts a Cloudflare Quick Tunnel that gives you a random *.trycloudflare.com URL to share. The tunnel stops automatically when the dev session ends. Quick tunnels don't require a Cloudflare account or any configuration.

    A warning is shown when Server-Sent Events (SSE) responses are detected through the tunnel, since quick tunnels don't support SSE.

  • #13661 0a5db08 Thanks @aspizu! - wrangler tail will now log stack traces. These stack traces already include resolved frames if you have chosen to upload sourcemaps.

  • #13617 118027d Thanks @roerohan! - Force Flagship bindings to always use remote mode in local dev

    Flagship bindings now always access the remote Flagship service during local development, matching the behavior of AI bindings. Previously, Flagship supported both local and remote modes, but the local stub only returned default values, providing no real functionality and creating a dual source of truth for flag evaluations.

    The remote config field is retained for backward compatibility but only controls whether a warning is displayed. Setting remote: true suppresses the warning that Flagship bindings always access remote resources and may incur usage charges in local dev.

  • #13254 e867ac2 Thanks @tgarg-cf! - Add wrangler queues consumer list subcommands for listing queue consumers

    Three new commands are available for listing consumers on a queue:

    • wrangler queues consumer list <queue-name> — lists all consumers (both worker and HTTP pull), grouped by type
    • wrangler queues consumer worker list <queue-name> — lists only worker consumers
    • wrangler queues consumer http list <queue-name> — lists only HTTP pull consumers

Patch Changes

  • #13696 62e9f2a Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260424.1 1.20260426.1
  • #13576 2dc6175 Thanks @MattieTK! - Restore telemetry tracking for common CLI flags that were unintentionally dropped during sanitisation

    When argument sanitisation was introduced, only explicitly allow-listed args had their values included in telemetry. The allow list was very conservative, which meant common boolean flags like --remote, --json, --dry-run, --force, and many others were no longer being captured in sanitizedArgs despite previously being tracked. Boolean flags are inherently safe (values are only true/false), so these have now been added back to the global allow list. A small number of fixed-choice args (--local-protocol, --upstream-protocol, --containers-rollout) have also been added with their known value sets.

  • #13649 ae8eae3 Thanks @petebacondarwin! - Fix service binding and tail consumer props being dropped between workers in different local dev instances

    When a service binding or tail consumer configured with props targeted a worker running in a separate wrangler dev instance (via the dev registry), the props were silently dropped and the remote entrypoint saw an empty ctx.props. Props are now forwarded correctly across the dev registry boundary, matching the behavior users get when all workers run in a single instance.

    // wrangler.json
    {
      "services": [
        {
          "binding": "AUTH",
          "service": "auth-worker", // may be in a separate `wrangler dev` process
          "entrypoint": "SessionEntry",
          "props": { "tenant": "acme" }
        }
      ]
    }
    

    The target worker's SessionEntry entrypoint now correctly receives { tenant: "acme" } on ctx.props regardless of which local dev instance it runs in.

  • #13662 f2e2241 Thanks @petebacondarwin! - Fix three resource leaks in unstable_startWorker teardown that could prevent Node from exiting cleanly after worker.dispose().

    • The esbuild context created by bundleWorker is now disposed when the initial build fails. Previously a failing initial build (e.g. an unresolvable entrypoint, or a worker started with an invalid config via setConfig) left the esbuild child process running for the lifetime of the parent Node process.
    • runBuild's cleanup function now awaits the in-flight build before running the bundler's stop handler. Previously teardown could return before esbuild.BuildContext.dispose() had been called, so the esbuild watcher kept the event loop alive after dispose had resolved.
    • BundlerController.teardown() now runs the esbuild cleanup before removing the bundler's temporary directory, and aborts the in-flight bundle build so it cannot emit stale bundleStart/bundleComplete events after teardown. Previously the tmpdir was removed first, which in race with an in-flight rebuild produced confusing "Could not resolve .wrangler/tmp/bundle-XXXX/middleware-loader.entry.ts" errors during dispose.
  • #13674 4f6ed93 Thanks @petebacondarwin! - Stop emitting a misleading [wrangler:error] Docker build exited with code: <n> log when the user aborts an in-progress container image build (for example by pressing the r rebuild hotkey while the previous build is still running).

    The abort-detection branch in the local and multi-worker runtime controllers was matching the wrong error message — it checked for "Build exited with code: 1", but the error thrown by the docker build helper is actually "Docker build exited with code: <n>", and the exit code after a process-group SIGINT/SIGKILL is typically 130/137/143, not 1. As a result, every legitimate user-initiated rebuild abort produced a spurious error event and [wrangler:error] log line. The check now matches the real error message prefix and ignores any non-zero exit code from the aborted build, so a user-requested rebuild while another build is in progress is silent.

  • #13667 ed2f4ec Thanks @emily-shen! - fix: Preserve auth in remote proxy session data to avoid unnecessary session restarts

    maybeStartOrUpdateRemoteProxySession was not including auth in its return value, so on subsequent calls preExistingRemoteProxySessionData.auth was always undefined. This caused the auth comparison to always detect a change, disposing and recreating the remote proxy session on every reload even when auth had not changed.

  • #13695 92bb8a5 Thanks @alexanderniebuhr! - wrangler types --check no longer throws when the types file was generated with an explicit boolean flag. Previously, yargs would parse such flags as actual booleans rather than strings, causing an internal parse error.

  • #13662 f2e2241 Thanks @petebacondarwin! - Fix the wrangler tail command leaking a signal-exit listener after the tail has been cleanly closed.

    The tail command registered both a tail.on("close", exit) listener and a process-level onExit(exit) handler, but never removed the latter after exit() had run. In long-lived CLI processes this is harmless — the handler eventually runs once on shutdown — but in unit tests that repeatedly invoke wrangler tail, every invocation accumulates a handler that fires during test-runner shutdown. Those late invocations call deleteTail() after the test's auth mocks have been torn down, producing spurious "Not logged in" unhandled rejections which fail the Linux CI runs.

    The handler is now removed as soon as exit() runs, and exit() is guarded against re-entry so it is idempotent if both the WebSocket close event and a real signal fire for the same session.

  • #13187 fcc491a Thanks @dario-piotrowicz! - Recognize Hydrogen as a known unsupported framework in autoconfig

    Previously, Hydrogen projects were incorrectly identified as React Router (since Hydrogen uses React Router under the hood), leading to a confusing autoconfig experience. Hydrogen is now recognized as a distinct unsupported framework, so users see a clear message that Hydrogen is not yet supported instead of being guided through React Router configuration.

  • #13628 e6c437a Thanks @emily-shen! - fix: prioritise CLOUDFLARE_ACCOUNT_ID over a cached account id for all Pages commands

    Previously, some Pages commands (pages deploy, pages deployment list/delete/tail, pages download config, pages secret) used a cached account id over the CLOUDFLARE_ACCOUNT_ID environment variable. The pages project commands already correctly prioritised CLOUDFLARE_ACCOUNT_ID.

  • Updated dependencies [21b87b2, 62e9f2a, 033d6ec, ae8eae3, ef24ff2, 6d27479, 118027d]:

4.85.0

Minor Changes

  • #13222 5680287 Thanks @maxwellpeterson! - Add enabled and previews_enabled support for custom domain routes

    Custom domain routes can now include optional enabled and previews_enabled boolean fields to control whether a custom domain serves production and/or preview traffic. When omitted, the API defaults apply (production enabled, previews disabled).

Patch Changes

  • #13622 5a2968a Thanks @petebacondarwin! - Fix inherited ai_search_namespaces binding display in wrangler deploy

    When an ai_search_namespaces binding inherits from the existing deployment, the bindings table now correctly shows (inherited) instead of a raw Symbol(inherit_binding) string.

  • #13633 3494842 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260421.1 1.20260422.1
  • #13645 7d728fb Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260422.1 1.20260423.1
  • #13657 df9319d Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260423.1 1.20260424.1
  • #13574 d5e3c57 Thanks @dario-piotrowicz! - Detect Cloudflare WAF block pages and include Ray ID in API error messages

    When the Cloudflare WAF blocks an API request, the response is an HTML page rather than JSON. Previously, this caused a confusing "Received a malformed response from the API" error with a truncated HTML snippet. Wrangler now detects WAF block pages and displays a clear error message explaining that the request was blocked by the firewall, along with the Cloudflare Ray ID (when available) for use in support tickets.

    For other non-JSON responses that aren't WAF blocks, the "malformed response" error also now includes the Ray ID to help reference failing requests in support tickets.

  • #13560 7567ef7 Thanks @vaishnav-mk! - Preserve NonRetryableError message and name when the workflows_preserve_non_retryable_error_message compatibility flag is enabled, instead of replacing it with a generic error message.

  • #11784 2831b54 Thanks @JPeer264! - fix(wrangler): Bind the console methods directly instead of using a global proxy

  • #13644 377715d Thanks @MattieTK! - Update @clack/core and @clack/prompts to v1.2.0

    Bumps the bundled @clack/core dependency used internally by @cloudflare/cli from 0.3.x to 1.2.0, and the @clack/prompts dependency in create-cloudflare from 0.6.x to 1.2.0. Clack v1 includes a number of API changes, but no user-facing prompt behaviour changes are expected.

  • Updated dependencies [3494842, 7d728fb, df9319d, 3ceeec3, 7567ef7, 0a95061, 7fc50c1, 377715d]:

4.84.1

Patch Changes

  • #13615 8fec8b8 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260420.1 1.20260421.1
  • #13572 a610749 Thanks @dario-piotrowicz! - Fix wrangler types --check ignoring --env-interface and secondary --config entries

    Previously, wrangler types --check ran its staleness check before resolving the --env-interface flag and before collecting secondary worker entry points from additional --config arguments. This meant it could incorrectly report types as up to date when they were actually stale due to a different env interface name or changes in secondary worker configs. The check now runs after all options are fully resolved, so it correctly detects mismatches.

  • Updated dependencies [8fec8b8, 2f3d7b9]:

4.84.0

Minor Changes

  • #13326 4a9ba90 Thanks @mattzcarey! - Add Artifacts binding support to wrangler

    You can now configure Artifacts bindings in your wrangler configuration:

    // wrangler.jsonc
    {
      "artifacts": [{ "binding": "MY_ARTIFACTS", "namespace": "default" }]
    }
    

    Type generation produces the correct Artifacts type reference from the workerd type definitions:

    interface Env {
      MY_ARTIFACTS: Artifacts;
    }
    
  • #13567 d8c895a Thanks @gpanders! - Rename the documented containers SSH config option to ssh

    Wrangler now accepts and documents containers.ssh in config files while continuing to accept containers.wrangler_ssh as an undocumented backwards-compatible alias. Wrangler still sends and reads wrangler_ssh when talking to the containers API.

  • #13571 7dc0433 Thanks @must108! - Add regional and jurisdictional placement constraints for Containers. Users can now set constraints.regions and constraints.jurisdiction in wrangler config to control where containers run.

  • #12600 50bf819 Thanks @penalosa! - Use workerd's debug port to power cross-process service bindings, Durable Objects, and tail workers via the dev registry. This enables Durable Object RPC via the dev registry, and is an overall stability improvement.

Patch Changes

  • #13160 05f4443 Thanks @JoaquinGimenez1! - Log a helpful error message when AI binding requests fail with a 403 authentication error

    Previously, when the AI proxy token expired during a long session, users received an unhelpful 403 error. Now, wrangler detects error code 1031 and suggests running wrangler login to refresh the token.

  • #13557 8ca78bb Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260415.1 1.20260416.2
  • #13579 b6e1351 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260416.2 1.20260417.1
  • #13604 d8314c6 Thanks @petebacondarwin! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260417.1 1.20260420.1
  • #13515 b35617b Thanks @petebacondarwin! - fix: ensure esbuild context is disposed during teardown

    The esbuild bundler cleanup function could race with the initial build. If BundlerController.teardown() ran before the initial build() completed, the stopWatching closure variable would still be undefined, so the esbuild context was never disposed. This left the esbuild child process running, keeping the Node.js event loop alive and causing processes to hang instead of exiting cleanly.

    The cleanup function now awaits the build promise before calling stopWatching, ensuring the esbuild context is always properly disposed.

  • #13470 4fda685 Thanks @penalosa! - fix: prevent remote binding sessions from expiring during long-running dev sessions

    Preview tokens for remote bindings expire after one hour. Previously, the first request after expiry would fail before a refresh was triggered. This change proactively refreshes the token at 50 minutes so no request ever sees an expired session.

    The reactive recovery path is also improved: error code: 1031 responses (returned by bindings such as Workers AI when their session times out) now correctly trigger a refresh, where previously only Invalid Workers Preview configuration HTML responses did.

    Auth credentials are now resolved lazily when a remote proxy session starts rather than at bundle-complete time. This means that if your OAuth access token has been refreshed since wrangler dev started, the new token is used rather than the one captured at startup.

  • #12456 59eec63 Thanks @venkatnikhilm! - Improve validation and error messaging for R2 CORS configuration files to catch AWS S3-style formatting mistake.

  • #13444 cc1413a Thanks @naile! - fix: Pass force query parameter to API in pages deployment delete

  • #11918 d0a9d1c Thanks @ksawaneh! - Allow wrangler r2 bucket list to run without a valid Wrangler config

    This is an account-level command and does not require parsing wrangler.toml/wrangler.jsonc. Previously, an invalid local config could prevent listing buckets, making it harder to fix the config.

  • #13516 4eb1da9 Thanks @jonnyparris! - Rename "Browser Rendering" to "Browser Run" in all user-facing strings, error messages, and CLI output.

  • #13575 6d887db Thanks @lambrospetrou! - Add D1 export prompt message for unavailability, use --skip-confirmation to not show the prompt.

  • #13473 5716d69 Thanks @MattieTK! - Update am-i-vibing to v0.1.1 for improved agentic environment detection

  • Updated dependencies [4a9ba90, b35617b, 8ca78bb, b6e1351, d8314c6, 7f50300, 4fda685, be5e6a0, e456952, 50bf819, 4eb1da9, 8ca78bb, 266c418]:

4.83.0

Minor Changes

  • #13391 60565dd Thanks @mikenomitch! - Mark wrangler containers commands as stable

    This changes the status of the Containers CLI from open beta to stable. Wrangler no longer shows [open beta] labels or beta warning text for wrangler containers commands, so the help output matches the feature's current availability.

  • #13311 6cbcdeb Thanks @ryanking13! - JS files imported by the Python Workers runtime SDK are now handled as ESM modules.

    This is not a user-facing change, but Python Workers users should update their wrangler version to make sure to get Python workers SDK working properly.

Patch Changes

  • #13450 6f63eaa Thanks @petebacondarwin! - Fix POST/PUT requests with non-2xx responses throwing "fetch failed"

    Previously, sending a POST or PUT request that received a non-2xx response (e.g. 401, 400, 403) would throw a TypeError: fetch failed error. This was caused by an undici bug where isTraversableNavigable() incorrectly returned true, causing the 401 credential-retry block to execute in Node.js and fail on stream-backed request bodies. This has been fixed upstream in undici v7.24.8, so we've bumped our dependency and removed the previous pnpm patch workaround.

  • #13447 aef9825 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260410.1 1.20260413.1
  • #13475 eaaa728 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260413.1 1.20260415.1
  • #13386 5e5bbc1 Thanks @mksglu! - Make startup network requests non-blocking on slow connections

    Wrangler makes network requests during startup (npm update check, request.cf data fetch) that previously blocked the CLI indefinitely on slow or degraded connections (airplane wifi, trains), causing 10+ second delays.

    • Update check: The banner now races the update check against a 100ms grace period. On a cache hit (most runs) the result resolves in <1ms via the I/O poll phase; on a cache miss the banner prints immediately without blocking. A 3s safety-net timeout caps the update-check library's auth-retry path.
    • request.cf fetch: The fetch to workers.cloudflare.com/cf.json now uses AbortSignal.timeout(3000), falling back to cached/default data on timeout.
  • #13469 07a918c Thanks @1000hz! - wrangler preview no longer warns on inheritable binding types being missing from previews config.

  • #13463 90aee27 Thanks @roerohan! - Remove unnecessary flagship:read OAuth scope

    The flagship:read scope is not needed since flagship:write already implies read access. This reduces the OAuth permissions requested during login to only what is required.

  • Updated dependencies [854d66c, 6f63eaa, aef9825, eaaa728, 58292f6, 5e5bbc1, d5ff5a4, 89c7829]:

4.82.2

Patch Changes

4.82.1

Patch Changes

  • #13453 6b11b07 Thanks @petebacondarwin! - Disable flagship OAuth scopes that are not yet valid in the Cloudflare backend

    The flagship:read and flagship:write OAuth scopes have been temporarily commented out from the default scopes requested during login, as they are not yet recognized by the Cloudflare backend.

  • #13438 dd4e888 Thanks @dependabot! - fix: handle Vike config files that use a variable-referenced default export

    Newer versions of create-vike (0.0.616+) generate pages/+config.ts files using const config: Config = { ... }; export default config; instead of the previous export default { ... } satisfies Config;. The Wrangler autoconfig AST transformation now resolves Identifier exports to their variable declarations, supporting both old and new Vike config file formats.

4.82.0

Minor Changes

  • #13353 5338bb6 Thanks @mattzcarey! - Add artifacts:write to Wrangler's default OAuth scopes, enabling wrangler login to request access to Cloudflare Artifacts (registries and artifacts).

  • #13139 79fd529 Thanks @roerohan! - feat: add Flagship feature flag binding support

    Adds end-to-end support for the Flagship feature flag binding, which allows Workers to evaluate feature flags from Cloudflare's Flagship service. Configure it in wrangler.json with a flagship array containing binding and app_id entries. In local dev, the binding returns default values for all flag evaluations; use "remote": true in the binding to evaluate flags against the live Flagship service.

  • #12983 28bc2be Thanks @1000hz! - Added the wrangler preview command family for creating Preview deployments (currently in private beta).

  • #13197 4fd138b Thanks @shahsimpson! - Add preview output-file entries for wrangler preview deployments

    wrangler preview now writes a preview entry to the Wrangler output file when WRANGLER_OUTPUT_FILE_PATH or WRANGLER_OUTPUT_FILE_DIRECTORY is configured. The entry includes the Worker name, preview metadata (preview_id, preview_name, preview_slug, preview_urls) and deployment metadata (deployment_id, deployment_urls).

    This makes preview command runs machine-readable in the same output stream as other Wrangler commands, which helps CI integrations consume preview URLs and IDs directly.

  • #13159 bafb96b Thanks @ruifigueira! - Add wrangler browser commands for managing Browser Rendering sessions

    New commands for Browser Rendering DevTools:

    • wrangler browser create [--lab] [--keepAlive <seconds>] [--open] - Create a new session
    • wrangler browser close <sessionId> - Close a session
    • wrangler browser list - List active sessions
    • wrangler browser view [sessionId] [--target <selector>] [--open] - View a live browser session

    The view command auto-selects when only one session exists, or prompts for selection when multiple are available.

    The --open flag controls whether to open DevTools in browser (default: true in interactive mode, false in CI/scripts). Use --no-open to just print the DevTools URL.

    All commands support --json for programmatic output. Also adds browser:write OAuth scope to wrangler login.

  • #13392 2589395 Thanks @emily-shen! - Add telemetry to local REST API

    The local REST API (used by the local explorer) now collects anonymous usage telemetry. This respects any existing telemetry preferences, which can be disabled by running the command wrangler telemetry disable.

    This only applies when the dev session is started via Wrangler, and not via the Vite plugin or standalone Miniflare.

    No actual data values, keys, query contents, or resource IDs are collected.

    Event schema:

    {
      "event": "localapi.<route>.<method>", // e.g. localapi.kv.keys.get
      "deviceId": "<uuid>",
      "timestamp": 1234567890,
      "properties": {
        "userAgent": "Mozilla/5.0 ...",
        // Only for localapi.local.workers.get:
        "workerCount": 2,
        "kvCount": 3,
        "d1Count": 1,
        "r2Count": 0,
        "doCount": 1,
        "workflowsCount": 0
      }
    }
    

    Note: the Local Explorer and corresponding local REST API is still an experimental feature.

  • #13137 1313275 Thanks @emily-shen! - explorer: expose the local explorer hotkey

    List the local explorer's hotkey [e] in wrangler dev output.

Patch Changes

  • #13393 c50cb5b Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260409.1 1.20260410.1
  • #13424 525a46b Thanks @paulelliotco! - Keep proxy notices off stdout for JSON Wrangler commands

    Wrangler now writes the startup notice for HTTP_PROXY and HTTPS_PROXY to stderr instead of stdout. This keeps commands like wrangler auth token --json machine-readable when a proxy is configured.

  • Updated dependencies [79fd529, c50cb5b, 2589395, 5eff8c1]:

4.81.1

Patch Changes

  • #13337 c510494 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260405.1 1.20260408.1
  • #13362 8b71eca Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260408.1 1.20260409.1
  • #13329 7ca6f6e Thanks @G4brym! - fix: Treat AI Search bindings as always-remote in local dev

    AI Search namespace (ai_search_namespaces) and instance (ai_search) bindings are always-remote (they have no local simulation), but pickRemoteBindings() did not include them in its always-remote type list. This caused the remote proxy session to exclude these bindings when remote: true was not explicitly set in the config, resulting in broken AI Search bindings during wrangler dev.

    Additionally, removeRemoteConfigFieldFromBindings() in the deploy config-diff logic was not stripping the remote field from AI Search bindings, which could cause false config diffs during deployment.

  • Updated dependencies [42c7ef0, c510494, 8b71eca, a42e0e8]:

4.81.0

Minor Changes

  • #12932 96ee5d4 Thanks @thomasgauvin! - feat: add wrangler email routing and wrangler email sending commands

    Email Routing commands:

    • wrangler email routing list - list zones with email routing status
    • wrangler email routing settings <domain> - get email routing settings for a zone
    • wrangler email routing enable/disable <domain> - enable or disable email routing
    • wrangler email routing dns get/unlock <domain> - manage DNS records
    • wrangler email routing rules list/get/create/update/delete <domain> - manage routing rules (use catch-all as the rule ID for the catch-all rule)
    • wrangler email routing addresses list/get/create/delete - manage destination addresses

    Email Sending commands:

    • wrangler email sending list - list zones with email sending
    • wrangler email sending settings <domain> - get email sending settings for a zone
    • wrangler email sending enable <domain> - enable email sending for a zone or subdomain
    • wrangler email sending disable <domain> - disable email sending for a zone or subdomain
    • wrangler email sending dns get <domain> - get DNS records for a sending domain
    • wrangler email sending send - send an email using the builder API
    • wrangler email sending send-raw - send a raw MIME email message

    Also adds email_routing:write and email_sending:write OAuth scopes to wrangler login.

Patch Changes

  • #13241 7d318e1 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260401.1 1.20260402.1
  • #13305 fa6d84f Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260402.1 1.20260405.1
  • #13193 78cbe37 Thanks @dario-piotrowicz! - During autoconfig filter out Hono when there are 2 detected frameworks

    During the auto-configuration process Hono is now treated as an auxiliary framework (like Vite) and automatically filtered out when two frameworks are detected (before Hono was being filtered out only when the other framework was Waku).

  • #13205 6fa5dfd Thanks @petebacondarwin! - fix: use formatConfigSnippet for compatibility_date warning in wrangler dev

    The compatibility_date warning shown when no date is configured in wrangler dev was hardcoded in TOML format. This now uses formatConfigSnippet to render the snippet in the correct format (TOML or JSON) based on the user's config file type.

  • Updated dependencies [a3e3b57, 7d318e1, fa6d84f, 7d318e1, 7a60d4b]:

4.80.0

Minor Changes

  • #13151 9c4035b Thanks @G4brym! - Add type generation for AI Search bindings

    Running wrangler types now generates AiSearchNamespace and AiSearchInstance types for ai_search_namespaces and ai_search config bindings respectively. Both simple and per-environment modes are supported.

    // wrangler.json
    {
      "ai_search_namespaces": [
        { "binding": "AI_SEARCH", "namespace": "production" }
      ],
      "ai_search": [
        { "binding": "BLOG_SEARCH", "instance_name": "cloudflare-blog" }
      ]
    }
    
    // Generated by `wrangler types`
    interface Env {
      AI_SEARCH: AiSearchNamespace;
      BLOG_SEARCH: AiSearchInstance;
    }
    
  • #13011 b9b7e9d Thanks @ruifigueira! - Add experimental headful browser rendering support for local development

    Experimental: This feature may be removed or changed without notice.

    When developing locally with the Browser Rendering API, you can enable headful (visible) mode via the X_BROWSER_HEADFUL environment variable to see the browser while debugging:

    X_BROWSER_HEADFUL=true wrangler dev
    X_BROWSER_HEADFUL=true vite dev
    

    Note: when using @cloudflare/playwright, two Chrome windows may appear — the initial blank page and the one created by browser.newPage(). This is expected behavior due to how Playwright handles browser contexts via CDP.

  • #12992 48d83ca Thanks @RiscadoA! - Add vpc_networks binding support for routing Worker traffic through a Cloudflare Tunnel or network.

    {
      "vpc_networks": [
        // Route through a specific Cloudflare Tunnel
        { "binding": "MY_FIRST_VPC", "tunnel_id": "<tunnel-id>" },
        // Route through the Cloudflare One mesh network
        { "binding": "MY_SECOND_VPC", "network_id": "cf1:network" }
      ]
    }
    

Patch Changes

  • #13155 5d29055 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260329.1 1.20260331.1
  • #13162 fb67a18 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260331.1 1.20260401.1
  • #13136 ab44870 Thanks @petebacondarwin! - Display build errors for auxiliary workers in multi-worker mode

    Previously, when running wrangler dev with multiple -c config flags (multi-worker mode), build errors from auxiliary/secondary workers were only logged at debug level, causing Wrangler to silently hang. Build errors from all workers are now displayed at error level so you can see what went wrong and fix it.

  • #12992 48d83ca Thanks @RiscadoA! - Fix remote proxy worker not catching errors thrown by bindings during wrangler dev

  • #13238 b2f53ea Thanks @guybedford! - Fix source phase imports in bundled and non-bundled Workers

    Wrangler now preserves import source syntax when it runs esbuild, including module format detection and bundled deploy output. This fixes both --no-bundle and bundled deployments for Workers that import WebAssembly using source phase imports.

  • #10126 14e72eb Thanks @nekoze1210! - fix: Sort D1 migration files to ensure consistent chronological ordering

    wrangler d1 migrations list and wrangler d1 migrations apply previously returned migration files in an order dependent on the filesystem, which could vary across operating systems. Migration filenames are now sorted alphabetically before being returned, ensuring consistent chronological ordering.

  • #13150 4dc94fd Thanks @dario-piotrowicz! - Polish Cloudflare Vite plugin installation during autoconfig

    Projects using Vite 6.0.x were rejected by auto-configuration because the minimum supported version was set to 6.1.0 (the @cloudflare/vite-plugin peer dependency). The minimum version check is now 6.0.0, and when a project has Vite in the [6.0.0, 6.1.0) range, auto-configuration will automatically upgrade it to the latest 6.x before installing @cloudflare/vite-plugin.

  • #13051 d5bffde Thanks @dario-piotrowicz! - Use today's date as the default compatibility date

    Previously, when generating a compatibility date for new projects or when no compatibility date was configured, the date was resolved by loading the locally installed workerd package via miniflare. This approach was unreliable in some package manager environments (notably pnpm). The logic now simply uses today's date instead, which is always correct and works reliably across all environments.

  • Updated dependencies [5d29055, fb67a18, d5bffde, b9b7e9d, b2f53ea, 48d83ca]:

4.79.0

Minor Changes

  • #12868 ffbc268 Thanks @danielgek! - Add wrangler ai-search command namespace for managing Cloudflare AI Search instances

    Introduces a CLI surface for the Cloudflare AI Search API (open beta), including:

    • Instance management: ai-search list, create, get, update, delete
    • Semantic search: ai-search search with repeatable --filter key=value flags
    • Instance stats: ai-search stats

    The create command uses an interactive wizard to guide configuration. All commands require authentication via wrangler login.

  • #13097 cd0e971 Thanks @pombosilva! - Add --local flag to Workflows commands for interacting with local dev

    All Workflows CLI commands now support a --local flag that targets a running wrangler dev session instead of the Cloudflare production API. This uses the /cdn-cgi/explorer/api/workflows endpoints served by the local dev server.

    wrangler workflows list --local
    wrangler workflows trigger my-workflow '{"key":"value"}' --local
    wrangler workflows instances describe my-workflow latest --local
    wrangler workflows instances pause my-workflow <id> --local --port 9000
    

    By default, commands continue to hit remote (production). Pass --local to opt in, and optionally --port to specify a custom dev server port (defaults to 8787).

Patch Changes

  • #13050 ed20a9b Thanks @dario-piotrowicz! - Add minimum and maximum version checks for frameworks during auto-configuration

    When Wrangler automatically configures a project, it now validates the installed version of the detected framework before proceeding:

    • If the version is below the minimum known-good version, the command exits with an error asking the user to upgrade the framework.
    • If the version is above the maximum known major version, a warning is emitted to let the user know the framework version has not been officially tested with this feature, and the command continues.
  • #13111 f214760 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260317.1 1.20260329.1
  • #13079 746858a Thanks @penalosa! - Fix getPlatformProxy and unstable_getMiniflareWorkerOptions crashing when assets is configured without a directory

    getPlatformProxy and unstable_getMiniflareWorkerOptions now skip asset setup when the config has an assets block but no directory — instead of throwing "missing required directory property". This happens when an external tool like @cloudflare/vite-plugin handles asset serving independently.

  • #13112 9aad27f Thanks @dario-piotrowicz! - Fix autoconfig failing on waku projects that use hono

    Waku has a tight integration with Hono, causing both to be detected simultaneously and triggering a "multiple frameworks found" error. Hono is now filtered out when Waku is also detected.

  • #13113 1fc5518 Thanks @dario-piotrowicz! - Skip lock file warning for static projects during autoconfig

    Previously, running autoconfig on a static project (one with no framework detected) would emit a misleading warning about a missing lock file, suggesting the project might be in a workspace. Since static projects don't require a lock file, this warning is now suppressed for them.

  • #13072 b539dc7 Thanks @jbwcloudflare! - Skip unnecessary GET /versions?deployable=true API call in wrangler versions deploy when all version IDs are explicitly provided and --yes is passed

    When deploying a specific version non-interactively (e.g. wrangler versions deploy <id> --yes), Wrangler previously always fetched the full list of deployable versions to populate the interactive selection prompt — even though the prompt is skipped entirely when --yes is used and all versions are already specified. The deployable-versions list is now only fetched when actually needed (i.e. when no version IDs are provided, or when running interactively).

  • #13115 2565b1d Thanks @dario-piotrowicz! - Improve error message when the assets directory path points to a file instead of a directory

    Previously, if the path provided as the assets directory (via --assets flag or assets.directory config) pointed to an existing file rather than a directory, Wrangler would throw an unhelpful ENOTDIR system error when trying to read the _redirects file inside it. Now Wrangler detects this condition earlier and throws a clear user error.

  • Updated dependencies [9eff028, f214760, 9282493, a532eea, d4c6158]:

4.78.0

Minor Changes

  • #13031 eeaa473 Thanks @WalshyDev! - Add support for Cloudflare Access Service Token authentication via environment variables

    When running wrangler dev with remote bindings behind a Cloudflare Access-protected domain, Wrangler previously required cloudflared access login which opens a browser for interactive authentication. This does not work in CI/CD environments.

    You can now set the CLOUDFLARE_ACCESS_CLIENT_ID and CLOUDFLARE_ACCESS_CLIENT_SECRET environment variables to authenticate using an Access Service Token instead:

    export CLOUDFLARE_ACCESS_CLIENT_ID="<your-client-id>.access"
    export CLOUDFLARE_ACCESS_CLIENT_SECRET="<your-client-secret>"
    wrangler dev
    

    Additionally, when running in a non-interactive environment (CI) without these credentials, Wrangler now throws a clear, actionable error instead of hanging on cloudflared access login.

  • #13027 9fcdfca Thanks @G4brym! - feat: Add ai_search_namespaces and ai_search binding types

    Two new binding types for AI Search:

    • ai_search_namespaces: Namespace binding — namespace is required and auto-provisioned at deploy time if it doesn't exist (like R2 buckets)
    • ai_search: Single instance binding bound directly to a pre-existing instance in the default namespace

    Both are remote-only in local dev.

  • #12874 53ed15a Thanks @xortive! - Add Workers VPC service support for Hyperdrive origins

    Hyperdrive configs can now connect to databases through Workers VPC services using the --service-id option:

    wrangler hyperdrive create my-config --service-id <vpc-service-uuid> --database mydb --user myuser --password mypassword
    

    This enables Hyperdrive to connect to databases hosted in private networks that are accessible through Workers VPC TCP services.

  • #12852 6b50bfa Thanks @Carolx715! - Add interactive data catalog validation to R2 object and lifecycle commands.

    When performing R2 operations that could affect data catalog state (object put, object delete, lifecycle add, lifecycle set), Wrangler now validates with the API and prompts users for confirmation if a conflict is detected. For bulk put operations, Wrangler prompts upfront before starting the batch. Users can bypass prompts with --force (-y). In non-interactive/CI environments, the operation proceeds automatically.

  • #13030 0386553 Thanks @natewong1313! - Add local mode support for Stream bindings

    Miniflare and wrangler dev now support using Cloudflare Stream bindings locally.

    Supported operations:

    • upload() — upload video via URL
    • video(id).details(), .update(), .delete(), .generateToken()
    • videos.list()
    • captions.generate(), .list(), .delete()
    • downloads.generate(), .get(), .delete()
    • watermarks.generate(), .list(), .get(), .delete()

    The following are not yet supported in local mode and will throw:

    • createDirectUpload()
    • Caption upload via File
    • Watermark generation via File

    Data is persisted across restarts by default. You must set streamPersist: false in Miniflare options to disable persistence.

  • #12874 53ed15a Thanks @xortive! - Add --cert-verification-mode option to wrangler vpc service create and wrangler vpc service update

    You can now configure the TLS certificate verification mode when creating or updating a VPC connectivity service. This controls how the connection to the origin server verifies TLS certificates.

    Available modes:

    • verify_full (default) -- verify certificate chain and hostname
    • verify_ca -- verify certificate chain only, skip hostname check
    • disabled -- do not verify the server certificate at all
    wrangler vpc service create my-service --type tcp --tcp-port 5432 --ipv4 10.0.0.1 --tunnel-id <tunnel-uuid> --cert-verification-mode verify_ca
    

    This applies to both TCP and HTTP VPC service types. When omitted, the default verify_full behavior is used.

  • #12874 53ed15a Thanks @xortive! - Add TCP service type support for Workers VPC

    You can now create TCP services in Workers VPC using the --type tcp option:

    wrangler vpc service create my-db --type tcp --tcp-port 5432 --ipv4 10.0.0.1 --tunnel-id <tunnel-uuid>
    

    This enables exposing TCP-based services like PostgreSQL, MySQL, and other database servers through Workers VPC.

Patch Changes

  • #13039 bc24ec8 Thanks @petebacondarwin! - fix: Angular auto-config now correctly handles projects without SSR configured

    Previously, running wrangler deploy (or wrangler setup) on a plain Angular SPA (created with ng new without --ssr) would crash with Cannot set properties of undefined (setting 'experimentalPlatform'), because the auto-config code unconditionally assumed SSR was configured.

    Angular projects without SSR are now treated as assets-only deployments: no wrangler.jsonc main entry is generated, angular.json is not modified, no src/server.ts is created, and no extra dependencies are installed.

  • #13036 0b4c21a Thanks @pbrowne011! - Fix wrangler deploy --dry-run skipping asset build-artifact validation checks

    Previously, --dry-run skipped the entire asset sync step, which meant it also skipped validation that runs during asset manifest building. This included the check that errors when a _worker.js file or directory would be uploaded as a public static asset (which can expose private server-side code), as well as the per-file size limit check.

    With this fix, --dry-run now runs buildAssetManifest against the asset directory when assets are configured, performing the same file-system validation as a real deploy without uploading anything or making any API calls.

  • #13061 535582d Thanks @petebacondarwin! - fix: resolve secondary worker types when environment overrides the worker name in multi-worker type generation

    When running wrangler types with multiple -c config flags and the secondary worker has named environments that override the worker name (e.g. a worker named do-worker with env staging whose effective name becomes do-worker-staging), service bindings and Durable Object bindings in the primary worker that reference do-worker-staging now correctly resolve to the typed entry point instead of falling back to an unresolved comment type such as DurableObjectNamespace /* MyClass from do-worker-staging */.

    The fix extends the secondary entries map to also register environment-specific worker names, so that lookups by the env-qualified name (e.g. do-worker-staging) resolve to the same source file as the base worker name.

  • #13058 992f9a3 Thanks @petebacondarwin! - fix: patch undici to prevent fetch() throwing on 401 responses with a request body

    Fetching with a request body (string, JSON, FormData, etc.) to an endpoint that returns a 401 would throw TypeError: fetch failed with cause expected non-null body source. This affected Unstable_DevWorker.fetch() and any other use of undici's fetch in wrangler.

    The root cause is isTraversableNavigable() in undici returning true unconditionally, causing the 401 credential-retry logic to run in Node.js where it should never apply (there is no browser UI to prompt for credentials). This is tracked upstream in nodejs/undici#4910. Until an upstream fix is released, we apply a patch to undici that returns false from isTraversableNavigable().

  • #13017 91b7f73 Thanks @petebacondarwin! - fix: prevent Docker container builds from spawning console windows on Windows

    On Windows, detached: true in child_process.spawn() gives each child process its own visible console window, causing many windows to flash open during wrangler deploy with [[containers]]. The detached option is now only set on non-Windows platforms (where it is needed for process group cleanup), and windowsHide: true is added to further suppress console windows on Windows.

  • #12996 f6cdab2 Thanks @guybedford! - Fix source phase imports in bundled and non-bundled Workers

    Wrangler now preserves import source syntax when it runs esbuild, including module format detection and bundled deploy output. This fixes both --no-bundle and bundled deployments for Workers that import WebAssembly using source phase imports.

  • #12931 ce65246 Thanks @dario-piotrowicz! - Improve error message when modules cannot be resolved during bundling

    When a module cannot be resolved during bundling, Wrangler now suggests using the alias configuration option to substitute it with an alternative implementation. This replaces esbuild's default suggestion to "mark the path as external", which is not a supported option in Wrangler.

    For example, if you try to import a module that doesn't exist:

    import foo from "some-missing-module";
    

    Wrangler will now suggest:

    To fix this, you can add an entry to "alias" in your Wrangler configuration
    to substitute "some-missing-module" with an alternative implementation.
    See https://developers.cloudflare.com/workers/wrangler/configuration/#bundling-issues
    

    This provides actionable guidance for resolving import errors.

  • #13049 7a5be20 Thanks @nikitassharma! - add library-push flag to containers registries credentials

    This flag is not available for public use.

  • #13018 9c5ebf5 Thanks @tgarg-cf! - Validate that queue consumers in wrangler config only use the "worker" type

    Previously, non-worker consumer types (e.g. http_pull) could be specified in the queues.consumers config. Now, wrangler will error if a consumer type other than "worker" is specified in the config file.

    To configure non-worker consumer types, use the wrangler queues consumer CLI commands instead (e.g. wrangler queues consumer http-pull add).

  • Updated dependencies [9fcdfca, 1faff35, f4ea4ac, 0386553]:

4.77.0

Minor Changes

  • #13023 593c4db Thanks @jamesopstad! - Add wrangler versions upload support for the experimental secrets configuration property

    When the new secrets property is defined, wrangler versions upload now validates that all secrets declared in secrets.required are configured on the Worker before the upload succeeds. If any required secrets are missing, the upload fails with a clear error listing which secrets need to be set.

    When secrets is not defined, the existing behavior is unchanged.

    // wrangler.jsonc
    {
      "secrets": {
        "required": ["API_KEY", "DB_PASSWORD"]
      }
    }
    
  • #12732 c2e9163 Thanks @jamesopstad! - Add deploy support for the experimental secrets configuration property

    When the new secrets property is defined, wrangler deploy now validates that all secrets declared in secrets.required are configured on the Worker before the deploy succeeds. If any required secrets are missing, the deploy fails with a clear error listing which secrets need to be set.

    When secrets is not defined, the existing behavior is unchanged.

    // wrangler.jsonc
    {
      "secrets": {
        "required": ["API_KEY", "DB_PASSWORD"]
      }
    }
    

Patch Changes

  • #12896 451dae3 Thanks @petebacondarwin! - fix: Add retry and timeout protection to remote preview API calls

    Remote preview sessions (wrangler dev --remote) now automatically retry transient 5xx API errors (up to 3 attempts with linear backoff) and enforce a 30-second per-request timeout. Previously, a single hung or failed API response during session creation or worker upload could block the dev session reload indefinitely.

  • #12569 379f2a2 Thanks @MattieTK! - Use qwik add cloudflare-workers instead of qwik add cloudflare-pages for Workers targets

    Both the wrangler autoconfig and C3 Workers template for Qwik were running qwik add cloudflare-pages even when targeting Cloudflare Workers. This caused the wrong adapter directory structure to be scaffolded (adapters/cloudflare-pages/ instead of adapters/cloudflare-workers/), and required post-hoc cleanup of Pages-specific files like _routes.json.

    Qwik now provides a dedicated cloudflare-workers adapter that generates the correct Workers configuration, including wrangler.jsonc with main and assets fields, a public/.assetsignore file, and the correct adapters/cloudflare-workers/vite.config.ts.

    Also adds --skipConfirmation=true to all qwik add invocations so the interactive prompt is skipped in automated contexts.

  • #11899 9a1cf29 Thanks @hoodmane! - Remove cf-requirements support for Python workers. It hasn't worked with the runtime for a while now.

  • #11800 875da60 Thanks @southpolesteve! - Add upgrade hint to unexpected configuration field warnings when an update is available

    When Wrangler encounters unexpected fields in the configuration file and a newer version of Wrangler is available, it now displays a message suggesting to update. This helps users who may be using configuration options that were added in a newer version of Wrangler.

  • Updated dependencies [b8f3309, 5aaaab2, 5aaaab2, f8516dd, 9c9fe30, 6a6449e]:

4.76.0

Minor Changes

  • #12893 782df44 Thanks @gpanders! - Rewrite wrangler containers list to use the paginated Dash API endpoint

    wrangler containers list now fetches from the /dash/applications endpoint instead of /applications, displaying results in a paginated table with columns for ID, Name, State, Live Instances, and Last Modified. Container state is derived from health instance counters (active, degraded, provisioning, ready).

    The command supports --per-page (default 25) for interactive pagination with Enter to load more and q/Esc to quit, and --json for machine-readable output. Non-interactive environments load all results in a single request.

  • #12957 62545c9 Thanks @natewong1313! - Add Stream binding support to Wrangler and workers-utils

    Wrangler and workers-utils now recognize the stream binding in configuration, deployment metadata, and generated worker types. This enables projects to declare Stream bindings in wrangler.json and have the binding represented consistently across validation, metadata mapping, and type generation.

  • #12848 ce48b77 Thanks @emily-shen! - Enable local explorer by default

    This ungates the local explorer, a UI that lets you inspect the state of D1, DO and KV resources locally by visiting /cdn-cgi/explorer during local development.

    Note: this feature is still experimental, and can be disabled by setting the env var X_LOCAL_EXPLORER=false.

Patch Changes

  • #12938 71ab981 Thanks @dario-piotrowicz! - Add backward-compatible autoconfig support for Astro v5 and v4 projects

    The astro add cloudflare command in older Astro versions installs the latest adapter version, which causes compatibility issues. This change adds manual configuration logic for projects using Astro versions before 6.0.0:

    • Astro 6.0.0+: Uses the native astro add cloudflare command (unchanged behavior)
    • Astro 5.x: Installs @astrojs/cloudflare@12 and manually configures the adapter
    • Astro 4.x: Installs @astrojs/cloudflare@11 and manually configures the adapter
    • Astro < 4.0.0: Returns an error prompting the user to upgrade
  • #11892 7c3c6c6 Thanks @staticpayload! - Handle registry ports when matching container image digests

    Wrangler now strips tags without breaking registry ports when comparing local images to remote digests. This prevents unnecessary pushes for tags like localhost:5000/app:tag.

  • Updated dependencies [3c988e2, d028ffb, cb71403, 3a1c149, ce48b77, 8729f3d]:

4.75.0

Minor Changes

  • #12492 3b81fc6 Thanks @thomasgauvin! - feat: add wrangler tunnel commands for managing Cloudflare Tunnels

    Adds a new set of commands for managing remotely-managed Cloudflare Tunnels directly from Wrangler:

    • wrangler tunnel create <name> - Create a new Cloudflare Tunnel
    • wrangler tunnel list - List all tunnels in your account
    • wrangler tunnel info <tunnel> - Display details about a specific tunnel
    • wrangler tunnel delete <tunnel> - Delete a tunnel (with confirmation)
    • wrangler tunnel run <tunnel> - Run a tunnel using cloudflared
    • wrangler tunnel quick-start <url> - Start a temporary tunnel (Try Cloudflare)

    The run and quick-start commands automatically download and manage the cloudflared binary, caching it in ~/.wrangler/cloudflared/. Users are prompted before downloading and warned if their PATH-installed cloudflared is outdated. You can override the binary location with the CLOUDFLARED_PATH environment variable.

    All commands are marked as experimental.

Patch Changes

  • #12927 c9b3184 Thanks @penalosa! - Bump undici from 7.18.2 to 7.24.4

  • #12875 13df6c7 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260312.1 1.20260316.1
  • #12935 df0d112 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260316.1 1.20260317.1
  • #12928 81ee98e Thanks @petebacondarwin! - Migrate chrome-devtools-patches deployment from Cloudflare Pages to Workers + Assets

    The DevTools frontend is now deployed as a Cloudflare Workers + Assets project instead of a Cloudflare Pages project. This uses wrangler deploy for production deployments and wrangler versions upload for PR preview deployments.

    The inspector proxy origin allowlists in both wrangler and miniflare have been updated to accept connections from the new workers.dev domain patterns, while retaining the legacy pages.dev patterns for backward compatibility.

  • #12835 c600ce0 Thanks @dario-piotrowicz! - Fix execution freezing on debugger statements when DevTools is not attached

    Previously, wrangler always sent Debugger.enable to the runtime on connection, even when DevTools wasn't open. This caused scripts to freeze on debugger statements. Now Debugger.enable is only sent when DevTools is actually attached, and Debugger.disable is sent when DevTools disconnects to stop the runtime from performing debugging work.

  • #12894 f509d13 Thanks @gpanders! - Simplify description of --json option

    Remove extraneous adjectives in the description of the --json option.

  • #11888 0a7fef9 Thanks @staticpayload! - Reject cross-drive module paths in Pages Functions routing

    On Windows, module paths using a different drive letter could be parsed in a way that bypassed the project-root check. These paths are now parsed correctly and rejected when they resolve outside the project.

  • Updated dependencies [c9b3184, 13df6c7, df0d112, 81ee98e]:

4.74.0

Minor Changes

  • #10896 351e1e1 Thanks @devin-ai-integration! - feat: add --secrets-file parameter to wrangler deploy and wrangler versions upload

    You can now upload secrets alongside your Worker code in a single operation using the --secrets-file parameter on both wrangler deploy and wrangler versions upload. The file format matches what's used by wrangler versions secret bulk, supporting both JSON and .env formats.

    Example usage:

    wrangler deploy --secrets-file .env.production
    wrangler versions upload --secrets-file secrets.json
    

    Secrets not included in the file will be inherited from the previous version, matching the behavior of wrangler versions secret bulk.

  • #12873 2b9a186 Thanks @gpanders! - Add wrangler containers instances <application_id> command to list container instances

    Lists all container instances for a given application, matching the Dash instances view. Displays instance ID, state, location, version, and creation time. Supports pagination for applications with many instances. Also adds paginated request support to the containers-shared API client.

Patch Changes

  • #12873 2b9a186 Thanks @gpanders! - Add escapeCodeTimeout option to onKeyPress utility for faster Esc key detection

    The onKeyPress utility now accepts an optional escapeCodeTimeout parameter that controls how long readline waits to disambiguate a standalone Esc press from multi-byte escape sequences (e.g. arrow keys). The default remains readline's built-in 500ms, but callers can pass a lower value (e.g. 25ms) for near-instant Esc handling in interactive prompts.

  • #12676 65f1092 Thanks @dario-piotrowicz! - Fix autoconfig package installation always failing at workspace roots

    When running autoconfig at the root of a monorepo workspace, package installation commands now include the appropriate workspace root flags (--workspace-root for pnpm, -W for yarn). This prevents errors like "Running this command will add the dependency to the workspace root" that previously occurred when configuring projects at the workspace root.

    Additionally, autoconfig now allows running at the workspace root if the root directory itself is listed as a workspace package (e.g., workspaces: ["packages/*", "."]).

  • #12841 7b0d8f5 Thanks @dario-piotrowicz! - Fix unclear error when assets upload session returns a null response

    When deploying assets, if the Cloudflare API returns a null response object, Wrangler now provides a clear error message asking users to retry instead of failing with a confusing error.

  • Updated dependencies [ade0aed]:

4.73.0

Minor Changes

  • #12853 ff543e3 Thanks @gpanders! - Deprecate SSH passthrough flags in wrangler containers ssh

    The --cipher, --log-file, --escape-char, --config-file, --pkcs11, --identity-file, --mac-spec, --option, and --tag flags are now deprecated. These flags expose OpenSSH-specific options that are tied to the current implementation. A future release will replace the underlying SSH transport, at which point these flags will be removed. They still function for now.

  • #12815 e63539d Thanks @NuroDev! - Support disabling persistence in unstable_startWorker() and unstable_dev()

    You can now disable persistence entirely by setting persist: false in the dev options:

    const worker = await unstable_dev("./src/worker.ts", {
      persist: false,
    });
    

    Or when using unstable_startWorker():

    const worker = await unstable_startWorker({
      entrypoint: "./src/worker.ts",
      dev: {
        persist: false,
      },
    });
    

    This is useful for testing scenarios where you want to ensure a clean state on each run without any persisted data from previous runs.

Patch Changes

  • #12861 f7de0fd Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260310.1 1.20260312.1
  • #12734 8e89e85 Thanks @flostellbrink! - Add back support for wrangler d1 exports with multiple tables.

    Example:

    # All tables (default)
    wrangler d1 export db --output all-tables.sql
    
    # Single table (unchanged)
    wrangler d1 export db --output single-table.sql --table foo
    
    # Multiple tables (new)
    wrangler d1 export db --output multiple-tables.sql --table foo --table bar
    
  • #12807 8d1e130 Thanks @MaxwellCalkin! - fix: vectorize commands now output valid json

    This fixes:

    • wrangler vectorize create
    • wrangler vectorize info
    • wrangler vectorize insert
    • wrangler vectorize upsert
    • wrangler vectorize list
    • wrangler vectorize list-vectors
    • wrangler vectorize list-metadata-index

    Also, wrangler vectorize create --json now also includes the created_at, modified_on and description fields.

  • #12856 6ee18e1 Thanks @dario-piotrowicz! - Fix autoconfig for Astro v6 projects to skip wrangler config generation

    Astro 6+ generates its own wrangler configuration on build, so autoconfig now detects the Astro version and skips creating a wrangler.jsonc file for projects using Astro 6 or later. This prevents conflicts between the autoconfig-generated config and Astro's built-in config generation.

  • #12700 4bb61b9 Thanks @RiscadoA! - Add client-side validation for VPC service host flags

    The --hostname, --ipv4, and --ipv6 flags on wrangler vpc service create and wrangler vpc service update now validate input before sending requests to the API. Previously, invalid values were accepted by the CLI and only rejected by the API with opaque error messages. Now users get clear, actionable error messages for common mistakes like passing a URL instead of a hostname, using an IP address in the --hostname flag, or providing malformed IP addresses.

  • Updated dependencies [f7de0fd, ecc7f79, 1dda1c8]:

4.72.0

Minor Changes

  • #12746 211d75d Thanks @NuroDev! - Add support for inheritable bindings in type generation

    When using wrangler types with multiple environments, bindings from inheritable config properties (like assets) are now correctly inherited from the top-level config in all named environments. Previously, if you defined assets.binding at the top level with named environments, the binding would be marked as optional in the generated Env type because the type generation didn't account for inheritance.

    Example:

    {
      "assets": {
        "binding": "ASSETS",
        "directory": "./public"
      },
      "env": {
        "staging": {},
        "production": {}
      }
    }
    

    Before this change, ASSETS would be typed as ASSETS?: Fetcher (optional). Now, ASSETS is correctly typed as ASSETS: Fetcher (required). This fix currently applies to the assets binding, with an extensible mechanism to support additional inheritable bindings in the future.

  • #12826 de65c58 Thanks @gabivlj! - Enable container egress interception in local dev without the experimental compatibility flag

    Container local development now always prepares the egress interceptor sidecar image needed for interceptOutboundHttp(). This makes container-to-Worker interception available by default in Wrangler, Miniflare, and the Cloudflare Vite plugin.

Patch Changes

  • #12790 5451a7f Thanks @petebacondarwin! - Bump node-forge to ^1.3.2 to address security vulnerabilities

    node-forge had ASN.1 unbounded recursion, OID integer truncation, and ASN.1 validator desynchronization vulnerabilities. This is a bundled dependency used for local HTTPS certificate handling.

  • #12795 82cc2a8 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260301.1 1.20260306.1
  • #12811 3c67c2a Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260306.1 1.20260307.1
  • #12827 d645594 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260307.1 1.20260310.1
  • #12808 6ed249b Thanks @MaxwellCalkin! - Fix wrangler d1 execute --json returning "null" (string) instead of null (JSON null) for SQL NULL values

    When using wrangler d1 execute --json with local execution, SQL NULL values were incorrectly serialized as the string "null" instead of JSON null. This produced invalid JSON output that violated RFC 4627. The fix removes the explicit null-to-string conversion so NULL values are preserved as proper JSON null in the output.

  • #12824 9f93b54 Thanks @jamesopstad! - Strip query strings from module names before writing to disk

    When bundling modules with query string suffixes (e.g. .wasm?module), the ? character was included in the output filename. Since ? is not a valid filename character on Windows, this caused an ENOENT error during wrangler dev. This was particularly visible when using Prisma Client with the D1 adapter, which imports .wasm?module files.

    The fix strips query strings from module names before writing them to disk, while preserving correct module resolution.

  • #12771 b8c33f5 Thanks @penalosa! - Make remote dev exchange_url optional

    The edge-preview API's exchange_url is now treated as optional. When unavailable or when the exchange fails, the initial token from the API response is used directly. The prewarm step and inspector_websocket have been removed from the remote dev flow in favour of tail_url for live logs.

  • Updated dependencies [5451a7f, 82cc2a8, 3c67c2a, d645594, de65c58, cb14820, a7c87d1, e4d9510]:

4.71.0

Minor Changes

  • #11656 ec2459e Thanks @prydt! - feat(hyperdrive): add MySQL SSL mode and Custom CA support

    Hyperdrive now supports MySQL-specific SSL modes (REQUIRED, VERIFY_CA, VERIFY_IDENTITY) alongside the existing PostgreSQL modes. The --sslmode flag now validates the provided value based on the database scheme (PostgreSQL or MySQL) and enforces appropriate CA certificate requirements for each.

    Usage:

    # MySQL with CA verification
    wrangler hyperdrive create my-config --connection-string="mysql://user:pass@host:3306/db" --sslmode=VERIFY_CA --ca-certificate-id=<cert-id>
    
    # PostgreSQL (unchanged)
    wrangler hyperdrive create my-config --connection-string="postgres://user:pass@host:5432/db" --sslmode=verify-full --ca-certificate-id=<cert-id>
    

Patch Changes

4.70.0

Minor Changes

  • #11332 6a8aa5f Thanks @nikitassharma! - Users are now able to configure DockerHub credentials and have containers reference images stored there.

    DockerHub can be configured as follows:

    echo $PAT_TOKEN | npx wrangler@latest containers registries configure docker.io --dockerhub-username=user --secret-name=DockerHub_PAT_Token
    

    Containers can then specify an image from DockerHub in their wrangler.jsonc as follows:

    "containers": {
      "image": "docker.io/namespace/image:tag",
      ...
    }
    
  • #12649 35b2c56 Thanks @gabivlj! - Add experimental support for containers to workers communication with interceptOutboundHttp

    This feature is experimental and requires adding the "experimental" compatibility flag to your Wrangler configuration.

  • #12701 23a365a Thanks @jamesopstad! - Add local dev validation for the experimental secrets configuration property

    When the new secrets property is defined, wrangler dev and vite dev now validate secrets declared in secrets.required. When required secrets are missing from .dev.vars or .env/process.env, a warning is logged listing the missing secret names.

    When secrets is defined, only the keys listed in secrets.required are loaded. Additional keys in .dev.vars or .env are excluded. If you are not using .dev.vars, keys listed in secrets.required are loaded from process.env as well as .env. The CLOUDFLARE_INCLUDE_PROCESS_ENV environment variable is therefore not needed when using this feature.

    When secrets is not defined, the existing behavior is unchanged.

    // wrangler.jsonc
    {
      "secrets": {
        "required": ["API_KEY", "DB_PASSWORD"]
      }
    }
    
  • #12695 0769056 Thanks @jamesopstad! - Add type generation for the experimental secrets configuration property

    When the new secrets property is defined, wrangler types now generates typed bindings from the names listed in secrets.required.

    When secrets is defined at any config level, type generation uses it exclusively and no longer infers secret names from .dev.vars or .env files. This enables running type generation in environments where these files are not present.

    Per-environment secrets are supported. Each named environment produces its own interface, and the aggregated Env marks secrets that only appear in some environments as optional.

    When secrets is not defined, the existing behavior is unchanged.

    // wrangler.jsonc
    {
      "secrets": {
        "required": ["API_KEY", "DB_PASSWORD"]
      }
    }
    
  • #12693 150ef7b Thanks @martinezjandrew! - Add wrangler containers registries credentials command for generating temporary push/pull credentials

    This command generates short-lived credentials for authenticating with the Cloudflare managed registry (registry.cloudflare.com). Useful for CI/CD pipelines or local Docker authentication.

    # Generate push credentials (for uploading images)
    wrangler containers registries credentials registry.cloudflare.com --push
    
    # Generate pull credentials (for downloading images)
    wrangler containers registries credentials registry.cloudflare.com --pull
    
    # Generate credentials with both permissions
    wrangler containers registries credentials registry.cloudflare.com --push --pull
    
    # Custom expiration (default 15)
    wrangler containers registries credentials registry.cloudflare.com --push --expiration-minutes=30
    
  • #12622 bf9cb3d Thanks @LuisDuarte1! - Add configurable step limits for Workflows

    You can now set a maximum number of steps for a Workflow instance via the limits.steps configuration in your Wrangler config. When a Workflow instance exceeds this limit, it will fail with an error indicating the limit was reached.

    // wrangler.jsonc
    {
      "workflows": [
        {
          "binding": "MY_WORKFLOW",
          "name": "my-workflow",
          "class_name": "MyWorkflow",
          "limits": {
            "steps": 5000
          }
        }
      ]
    }
    

    The steps value must be an integer between 1 and 25,000. If not specified, the default limit of 10,000 steps is used. Step limits are also enforced in local development via wrangler dev.

Patch Changes

  • #12733 d672e2e Thanks @dario-piotrowicz! - Fix SolidStart autoconfig for projects using version 2.0.0-alpha or later

    SolidStart v2.0.0-alpha introduced a breaking change where configuration moved from app.config.(js|ts) to vite.config.(js|ts). Wrangler's autoconfig now detects the installed SolidStart version and based on it updates the appropriate configuration file

  • #12698 209b396 Thanks @penalosa! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260305.0 1.20260226.1
    @cloudflare/workers-types 4.20260305.0 4.20260226.1
  • #12691 596b8a0 Thanks @penalosa! - Remove temporary AI Search RPC workaround (no user-facing changes)

  • #12694 00e729e Thanks @garvit-gupta! - Fix wrangler pipelines setup failing for Data Catalog sinks on new buckets by using the correct R2 Catalog API error code (40401).

  • Updated dependencies [35b2c56, 5f7aaf2, 209b396, 596b8a0, bf9cb3d]:

4.69.0

Minor Changes

  • #12625 c0e9e08 Thanks @WillTaylorDev! - Add cache configuration option for enabling worker cache (experimental)

    You can now enable cache before worker execution using the new cache configuration:

    {
      "cache": {
        "enabled": true
      }
    }
    

    This setting is environment-inheritable and opt-in. When enabled, cache behavior is applied before your worker runs.

    Note: This feature is experimental. The runtime API is not yet generally available.

Patch Changes

  • #12661 99037e3 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260302.0 1.20260303.0
  • #12680 295297a Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260303.0 1.20260305.0
  • #12671 f765244 Thanks @MattieTK! - fix: Only redact account names in CI environments, not all non-interactive contexts

    The multi-account selection error in getAccountId now only redacts account names when running in a CI environment (detected via ci-info). Non-interactive terminals such as coding agents and piped commands can now see account names, which they need to identify which account to configure. CI logs remain protected.

  • Updated dependencies [99037e3, 295297a]:

4.68.1

Patch Changes

  • #12648 3d6e421 Thanks @petebacondarwin! - Fix Angular scaffolding to allow localhost SSR in development mode

    Recent versions of Angular's AngularAppEngine block serving SSR on localhost by default. This caused wrangler dev / wrangler pages dev to fail with URL with hostname "localhost" is not allowed.

    The fix passes allowedHosts: ["localhost"] to the AngularAppEngine constructor in server.ts, which is safe to do even in production since Cloudflare will already restrict which host is allowed.

  • #12657 294297e Thanks @dario-piotrowicz! - Update Waku autoconfig logic

    As of 1.0.0-alpha.4, Waku projects can be built on top of the Cloudflare Vite plugin, and the changes here allow Wrangler autoconfig to support this. Running autoconfig on older versions of Waku will result in an error.

  • Updated dependencies []:

4.68.0

Minor Changes

4.67.1

Patch Changes

  • #12595 e93dc01 Thanks @dario-piotrowicz! - Add a warning in the autoconfig logic letting users know that support for projects inside workspaces is limited

  • #12582 c2ed7c2 Thanks @penalosa! - Internal refactor to use capnweb's native ReadableStream support to power remote Media and Dispatch Namespace bindings.

  • #12618 d920811 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260219.0 1.20260227.0
  • #12637 896734d Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260227.0 1.20260302.0
  • #12601 ebdbe52 Thanks @43081j! - Switch to empathic for file-system upwards traversal to reduce dependency bloat.

  • #12602 58a4020 Thanks @anonrig! - Optimize filesystem operations by using Node.js's throwIfNoEntry: false option

    This reduces the number of system calls made when checking for file existence by avoiding the overhead of throwing and catching errors for missing paths. This is an internal performance optimization with no user-visible behavioral changes.

  • #12591 6f6cd94 Thanks @martinezjandrew! - Implemented logic within wrangler containers registries configure to check if a specified secret name is already in-use and offer to reuse that secret. Also added --skip-confirmation flag to the command to skip all interactive prompts.

  • Updated dependencies [c2ed7c2, d920811, 896734d, 58a4020]:

4.67.0

Minor Changes

  • #12401 8723684 Thanks @jonesphillip! - Add validation retry loops to pipelines setup command

    The wrangler pipelines setup command now prompts users to retry when validation errors occur, instead of failing the entire setup process. This includes:

    • Validation retry prompts for pipeline names, bucket names, and field names
    • A "simple" mode for sink configuration that uses sensible defaults
    • Automatic bucket creation when buckets don't exist
    • Automatic Data Catalog enablement when not already active

    This improves the setup experience by allowing users to correct mistakes without restarting the entire configuration flow.

  • #12395 aa82c2b Thanks @cmackenzie1! - Generate typed pipeline bindings from stream schemas

    When running wrangler types, pipeline bindings now generate TypeScript types based on the stream's schema definition. This gives you full autocomplete and type checking when sending data to your pipelines.

    // wrangler.json
    {
      "pipelines": [{ "binding": "ANALYTICS", "pipeline": "analytics-stream-id" }]
    }
    

    If your stream has a schema with fields like user_id (string) and event_count (int32), the generated types will be:

    declare namespace Cloudflare {
      type AnalyticsStreamRecord = { user_id: string; event_count: number };
      interface Env {
        ANALYTICS: Pipeline<Cloudflare.AnalyticsStreamRecord>;
      }
    }
    

    For unstructured streams or when not authenticated, bindings fall back to the generic Pipeline<PipelineRecord> type.

Patch Changes

  • #12592 aaa7200 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260217.0 1.20260218.0
  • #12606 2f19a40 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260218.0 1.20260219.0
  • #12604 e2a6600 Thanks @petebacondarwin! - fix: pass --env flag to auxiliary workers in multi-worker mode

    When running wrangler dev with multiple config files (e.g. -c ./apps/api/wrangler.jsonc -c ./apps/queues/wrangler.jsonc -e=dev), the --env flag was not being passed to auxiliary (non-primary) workers. This meant that environment-specific configuration (such as queue bindings) was not applied to auxiliary workers, causing features like queue consumers to not be triggered in local development.

  • #12597 0b17117 Thanks @sdnts! - The maximum allowed delivery and retry delays for Queues is now 24 hours

  • #12598 ca58062 Thanks @mattzcarey! - Stop redacting wrangler whoami output in non-interactive mode

    wrangler whoami is explicitly invoked to retrieve account info, so email and account names should always be visible. Redacting them in non-interactive/CI environments makes it difficult for coding agents and automated tools to identify which account to use. Other error messages that may appear unexpectedly in CI logs (e.g. multi-account selection errors) remain redacted.

  • Updated dependencies [f239077, aaa7200, 2f19a40, 5f9f0b4, 452cdc8, 527e4f5, 0b17117]:

4.66.0

Minor Changes

  • #12466 caf9b11 Thanks @petebacondarwin! - Add WRANGLER_CACHE_DIR environment variable and smart cache directory detection

    Wrangler now intelligently detects where to store cache files:

    1. Use WRANGLER_CACHE_DIR env var if set
    2. Use existing cache directory if found (node_modules/.cache/wrangler or .wrangler/cache)
    3. Create cache in node_modules/.cache/wrangler if node_modules exists
    4. Otherwise use .wrangler/cache

    This improves compatibility with Yarn PnP, pnpm, and other package managers that don't use traditional node_modules directories, without requiring any configuration.

  • #12572 936187d Thanks @dario-piotrowicz! - Ensure the nodejs_compat flag is always applied in autoconfig

    Previously, the autoconfig feature relied on individual framework configurations to specify Node.js compatibility flags, some could set nodejs_compat while others nodejs_als.

    Now instead nodejs_compat is always included as a compatibility flag, this is generally beneficial and the user can always remove the flag afterwards if they want to.

  • #12560 c4c86f8 Thanks @taylorlee! - Support --tag and --message flags on wrangler deploy

    They have the same behavior that they do as during wrangler versions upload, as both are set on the version.

    The message is also reused for the deployment as well, with the same behavior as used during wrangler versions deploy.

Patch Changes

  • #12543 5a868a0 Thanks @G4brym! - Fix AI Search binding failing in local dev

    Using AI Search bindings with wrangler dev would fail with "RPC stub points at a non-serializable type". AI Search bindings now work correctly in local development.

  • #12552 c58e81b Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260212.0 1.20260213.0
  • #12568 33a9a8f Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260213.0 1.20260214.0
  • #12576 8077c14 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260214.0 1.20260217.0
  • #12466 caf9b11 Thanks @petebacondarwin! - fix: exclude .wrangler directory from Pages uploads

    The .wrangler directory contains local cache and state files that should never be deployed. This aligns Pages upload behavior with Workers Assets, which already excludes .wrangler via .assetsignore.

  • #12556 7d2355e Thanks @ascorbic! - Fix port availability check probing the wrong host when host changes

    memoizeGetPort correctly invalidated its cached port when called with a different host, but then still probed the original host for port availability. This could return a port that was free on the original host but already in use on the requested one, leading to bind failures at startup.

  • #12562 7ea69af Thanks @MattieTK! - Support function-based Vite configs in autoconfig setup

    wrangler setup and wrangler deploy --x-autoconfig can now automatically add the Cloudflare Vite plugin to projects that use function-based defineConfig() patterns. Previously, autoconfig would fail with "Cannot modify Vite config: expected an object literal but found ArrowFunctionExpression" for configs like:

    export default defineConfig(({ isSsrBuild }) => ({
      plugins: [reactRouter(), tsconfigPaths()],
    }));
    

    This pattern is used by several official framework templates, including React Router's node-postgres and node-custom-server templates. The following defineConfig() patterns are now supported:

    • defineConfig({ ... }) (object literal, already worked)
    • defineConfig(() => ({ ... })) (arrow function with expression body)
    • defineConfig(({ isSsrBuild }) => ({ ... })) (arrow function with destructured params)
    • defineConfig(() => { return { ... }; }) (arrow function with block body)
    • defineConfig(function() { return { ... }; }) (function expression)
  • #12548 5cc7158 Thanks @dario-piotrowicz! - Fix .assetsignore formatting when autoconfig creates a new file

    Previously, when wrangler setup or wrangler deploy --x-autoconfig created a new .assetsignore file via autoconfig, it would add unnecessary leading empty lines before the wrangler-specific entries. Empty separator lines should only be added when appending to an existing .assetsignore file. This fix ensures newly created .assetsignore files start cleanly without leading blank lines.

  • #12556 7d2355e Thanks @ascorbic! - Improve error message when port binding is blocked by a sandbox or security policy

    When running wrangler dev inside a restricted environment (such as an AI coding agent sandbox or locked-down container), the port availability check would fail with a raw EPERM error. This now provides a clear message explaining that a sandbox or security policy is blocking network access, rather than the generic permission error that previously pointed at the file system.

  • #12545 c9d0f9d Thanks @dario-piotrowicz! - Improve framework detection when multiple frameworks are found

    When autoconfig detects multiple frameworks in a project, Wrangler now applies smarter logic to select the most appropriate one. Selecting the wrong one is acceptable locally where the user can change the detected framework, in CI an error is instead thrown.

  • #12548 5cc7158 Thanks @dario-piotrowicz! - Add trailing newline to generated package.json and wrangler.jsonc files

  • #12548 5cc7158 Thanks @dario-piotrowicz! - Fix .gitignore formatting when autoconfig creates a new file

    Previously, when wrangler setup or wrangler deploy created a new .gitignore file via autoconfig, it would add unnecessary leading empty lines before the wrangler-specific entries. Empty separator lines should only be added when appending to an existing .gitignore file. This fix ensures newly created .gitignore files start cleanly without leading blank lines.

  • #12545 c9d0f9d Thanks @dario-piotrowicz! - Throw actionable error when autoconfig is run in the root of a workspace

    When running Wrangler commands that trigger auto-configuration (like wrangler dev or wrangler deploy) in the root directory of a monorepo workspace, a helpful error is now shown directing users to run the command in a specific project's directory instead.

  • Updated dependencies [5a868a0, c58e81b, 33a9a8f, 8077c14, caf9b11, 9a565d5, 7f18183, 39491f9, 43c462a]:

4.65.0

Minor Changes

  • #12473 b900c5a Thanks @petebacondarwin! - Add CF_PAGES environment variables to wrangler pages dev

    wrangler pages dev now automatically injects Pages-specific environment variables (CF_PAGES, CF_PAGES_BRANCH, CF_PAGES_COMMIT_SHA, CF_PAGES_URL) for improved dev/prod parity. This enables frameworks like SvelteKit to auto-detect the Pages environment during local development.

    • CF_PAGES is set to "1" to indicate the Pages environment
    • CF_PAGES_BRANCH defaults to the current git branch (or "local" if not in a git repo)
    • CF_PAGES_COMMIT_SHA defaults to the current git commit SHA (or a placeholder if not in a git repo)
    • CF_PAGES_URL is set to a simulated commit preview URL (e.g., https://<sha>.<project-name>.pages.dev)

    These variables are displayed with their actual values in the bindings table during startup, making it easy to verify what branch and commit SHA were detected.

    These variables can be overridden by user-defined vars in the Wrangler configuration, .env, .dev.vars, or via CLI flags.

  • #12464 10a1c4a Thanks @petebacondarwin! - Allow deleting KV namespaces by name

    You can now delete a KV namespace by providing its name as a positional argument:

    wrangler kv namespace delete my-namespace
    

    This aligns the delete command with the create command, which also accepts a namespace name. The existing --namespace-id and --binding flags continue to work as before.

  • #12382 d7b492c Thanks @dario-piotrowicz! - Add Pages detection to autoconfig flows

    When running the autoconfig logic (via wrangler setup, wrangler deploy --x-autoconfig, or the programmatic autoconfig API), Wrangler now detects when a project appears to be a Pages project and handles it appropriately:

    • For wrangler deploy, it warns the user but still allows them to proceed
    • For wrangler setup and the programmatic autoconfig API, it throws a fatal error
  • #12461 8809411 Thanks @penalosa! - Support type: inherit bindings when using startWorker()

    This is an internal binding type that should not be used by external users of the API

  • #12515 1a9eddd Thanks @ascorbic! - Add --json flag to wrangler whoami for machine-readable output

    wrangler whoami --json now outputs structured JSON containing authentication status, auth type, email, accounts, and token permissions. When the user is not authenticated, the command exits with a non-zero status code and outputs {"loggedIn":false}, making it easy to check auth status in shell scripts without parsing text output.

    # Parse the JSON output
    wrangler whoami --json | jq '.accounts'
    
    # Check if authenticated in a script. Returns 0 if authenticated, non-zero if not.
    if wrangler whoami --json > /dev/null 2>&1; then
      echo "Authenticated"
    else
      echo "Not authenticated"
    fi
    
    

Patch Changes

  • #12437 ad817dd Thanks @MattieTK! - fix: use project's package manager in wranger autoconfig

    wrangler setup now correctly detects and uses the project's package manager based on lockfiles (pnpm-lock.yaml, yarn.lock, bun.lockb, package-lock.json) and the packageManager field in package.json. Previously, it would fall back to the package manager used to execute the command when run directly from the terminal, causing failures in pnpm and yarn workspace projects if the wrong manager was used in this step due to the workspace: protocol not being supported by npm.

    This change leverages the package manager detection already performed by @netlify/build-info during framework detection, ensuring consistent behaviour across the autoconfig process.

  • #12541 f7fa326 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260210.0 1.20260212.0
  • #12498 734792a Thanks @dario-piotrowicz! - Fix: make sure that remote proxy sessions's logs can be silenced when the wrangler log level is set to "none"

  • #12135 cc5ac22 Thanks @edmundhung! - Fix spurious config diffs when bindings from local and remote config are shown in different order

    When comparing local and remote Worker configurations, binding arrays like kv_namespaces would incorrectly show additions and removals if the elements were in a different order. The diff now correctly recognizes these as equivalent by reordering remote arrays to match the local config's order before comparison.

  • #12476 62a8d48 Thanks @MattieTK! - fix: use unscoped binary name for OpenNext autoconfig command overrides

    The build, deploy, and version command overrides in the Next.js (OpenNext) autoconfig handler used the scoped package name @opennextjs/cloudflare, which pnpm interprets as a workspace filter rather than a binary name. This caused wrangler deploy --x-autoconfig to fail for pnpm-based Next.js projects with ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL. Changed to use the unscoped binary name opennextjs-cloudflare, which resolves correctly across all package managers.

  • #12516 84252b7 Thanks @edmundhung! - Stop proxying localhost requests when proxy environment variables are set

    When HTTP_PROXY or HTTPS_PROXY is configured, all fetch requests including ones to localhost were routed through the proxy. This caused wrangler dev and the Vite plugin to fail with "TypeError: fetch failed" because the proxy can't reach local addresses.

    This switches from ProxyAgent to undici's EnvHttpProxyAgent, which supports the NO_PROXY environment variable. When NO_PROXY is not set, it defaults to localhost,127.0.0.1,::1 so local requests are never proxied.

    The NO_PROXY config only applies to the request destination, not the proxy server address. So a proxy running on localhost (e.g. HTTP_PROXY=http://127.0.0.1:11451) still works for outbound API calls.

  • #12506 e5efa5d Thanks @sesteves! - Fix wrangler r2 sql query displaying [object Object] for nested values

    SQL functions that return complex types such as arrays of objects (e.g. approx_top_k) were rendered as [object Object] in the table output because String() was called directly on non-primitive values. These values are now serialized with JSON.stringify so they display as readable JSON strings.

  • #11725 be9745f Thanks @dario-piotrowicz! - Fix incorrect logic during autoconfiguration (when running wrangler setup or wrangler deploy --x-autoconfig) that caused parts of the project's package.json file, removed during the process, to incorrectly be added back

  • #12458 122791d Thanks @jkoe-cf! - Remove default values for delivery delay and message retention and update messaging on limits

    Fixes the issue of the default maximum message retention (365400 seconds) being longer than the maximum allowed retention period for free tier users (86400 seconds).

    Previous:

    • Wrangler set a default value of 365400 seconds max message retention if the setting was not explicitly provided in the Wrangler configuration.
    • The maximum retention period was documented as 1209600 seconds for all queues users because it was required to be on paid tier.
    • Wrangler also set a default value of 0 seconds for delivery delay if the setting was not explicitly provided in the Wrangler configuration.

    Updated:

    • Wrangler no longer sets a default value for max message retention so that the default can be applied at the API.
    • The maximum retention period is now documented as 86400 seconds for free tier queues and 1209600 seconds for paid tier queues
    • Wrangler also no longer sets a default value for delivery delay so that the default can be applied at the API.
  • #12513 41e18aa Thanks @pombosilva! - Add confirmation prompt when deploying workflows with names that belong to different workers.

    When deploying a workflow with a name that already exists and is currently associated with a different worker script, Wrangler will now display a warning and prompt for confirmation before proceeding. This helps prevent accidentally overriding workflows.

    In non-interactive environments this check is skipped by default. Use the --strict flag to enable the check in non-interactive environments, which will cause the deployment to fail if workflow conflicts are detected.

  • Updated dependencies [f7fa326, 7aaa2a5, d06ad09]:

4.64.0

Minor Changes

  • #12433 2acb277 Thanks @martinezjandrew! - Updated registries delete subcommand to handle new API response that now returns a secrets store secret reference after deletion. Wrangler will now prompt the user if they want to delete the associated secret. If so, added new logic to retrieve a secret by its name. The subcommand will then delete the secret.

  • #12307 e02b5f5 Thanks @dario-piotrowicz! - Improve autoconfig telemetry with granular event tracking

    Adds detailed telemetry events to track the autoconfig workflow, including process start/end, detection, and configuration phases. Each event includes a unique session ID (appId), CI detection, framework information, and success/error status to help diagnose issues and understand usage patterns.

  • #12474 8ba1d11 Thanks @petebacondarwin! - Add wrangler pages deployment delete command to delete Pages deployments via CLI

    You can now delete a Pages deployment directly from the command line:

    wrangler pages deployment delete <deployment-id> --project-name <name>
    

    Use the --force (or -f) flag to skip the confirmation prompt, which is useful for CI/CD automation.

  • #12307 e02b5f5 Thanks @dario-piotrowicz! - Include all common telemetry properties in ad-hoc telemetry events

    Previously, only command-based telemetry events (e.g., "wrangler command started/completed") included the full set of common properties. Ad-hoc events sent via sendAdhocEvent were missing important context like OS information, CI detection, and session tracking.

    Now, all telemetry events include the complete set of common properties:

    • amplitude_session_id and amplitude_event_id for session tracking
    • wranglerVersion (and major/minor/patch variants)
    • osPlatform, osVersion, nodeVersion
    • packageManager
    • configFileType
    • isCI, isPagesCI, isWorkersCI
    • isInteractive
    • isFirstUsage
    • hasAssets
    • agent
  • #12479 fd902aa Thanks @dario-piotrowicz! - Add framework selection prompt during autoconfig

    When running autoconfig in interactive mode, users are now prompted to confirm or change the detected framework. This allows correcting misdetected frameworks or selecting a framework when none was detected, defaulting to "Static" in that case.

  • #12465 961705c Thanks @petebacondarwin! - Add --json flag to wrangler pages project list command

    You can now use the --json flag to output the project list as clean JSON instead of a formatted table. This enables easier programmatic processing and scripting workflows.

    > wrangler pages project list --json
    
    [
      {
        "Project Name": "my-pages-project",
        "Project Domains": "my-pages-project-57h.pages.dev",
        "Git Provider": "No",
        "Last Modified": "23 hours ago"
      },
      ...
    ]
    
  • #12470 21ac7ab Thanks @petebacondarwin! - Add WRANGLER_COMMAND environment variable to custom build commands

    When using a custom build command in wrangler.toml, you can now detect whether wrangler dev or wrangler deploy triggered the build by reading the WRANGLER_COMMAND environment variable.

    This variable will be set to "dev", "deploy", "versions upload", or "types" depending on which command invoked the build. This allows you to customize your build process based on the deployment context.

    Example usage in a build script:

    if [ "$WRANGLER_COMMAND" = "dev" ]; then
      echo "Building for development..."
    else
      echo "Building for production..."
    fi
    

Patch Changes

  • #12468 5d56487 Thanks @petebacondarwin! - Add debug logs for git branch detection in wrangler pages deploy command

    When running wrangler pages deploy, the command automatically detects git information (branch, commit hash, commit message, dirty state) from the local repository. Previously, when this detection failed, there was no way to troubleshoot the issue.

    Now, running with WRANGLER_LOG=debug will output detailed information about:

    • Whether a git repository is detected
    • Each git command being executed and its result
    • The detected values (branch, commit hash, commit message, dirty status)
    • Any errors that occur during detection

    Example usage:

    WRANGLER_LOG=debug wrangler pages deploy ./dist --project-name=my-project
    
  • #12447 c8dda16 Thanks @dario-piotrowicz! - fix: Throw a descriptive error when autoconfig cannot detect an output directory

    When running wrangler setup or wrangler deploy --x-autoconfig on a project where the output directory cannot be detected, you will now see a clear error message explaining what's missing (e.g., "Could not detect a directory containing the static (html, css and js) files for the project") instead of a generic configuration error. This makes it easier to understand and resolve the issue.

  • #12440 555b32a Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260205.0 1.20260206.0
  • #12485 d636d6a Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260206.0 1.20260207.0
  • #12502 bf8df0c Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260207.0 1.20260210.0
  • #12280 988dea9 Thanks @penalosa! - Fix wrangler init failing with Yarn Classic

    When using Yarn Classic (v1.x), running wrangler init or wrangler init --from-dash would fail because Yarn Classic doesn't properly handle version specifiers with special characters like ^ in yarn create commands. Yarn would install the package correctly but then fail to find the binary because it would look for a path like .yarn/bin/create-cloudflare@^2.5.0 instead of .yarn/bin/create-cloudflare.

    This fix removes the version specifier from the default C3 command entirely. Since C3 has had auto-update behavior for over two years, specifying a version is no longer necessary and removing it resolves the Yarn Classic compatibility issue.

  • #12486 1f1c3ce Thanks @vicb! - Bump esbuild to 0.27.3

    This update includes several bug fixes from esbuild versions 0.27.1 through 0.27.3. See the esbuild changelog for details.

  • #12472 62635a0 Thanks @petebacondarwin! - Improve D1 database limit error message to match Cloudflare dashboard

    When attempting to create a D1 database after reaching your account's limit, the CLI now shows a more helpful error message with actionable guidance instead of the raw API error.

    The new message includes:

    • A clear explanation that the account limit has been reached
    • A link to D1 documentation
    • Commands to list and delete databases
  • #12411 355c6da Thanks @jbwcloudflare! - Fix wrangler pages deploy to respect increased file count limits

  • #12449 bfd17cd Thanks @penalosa! - fix: Display unsafe metadata separately from bindings

    Unsafe metadata are not bindings and should not be displayed in the bindings table. They are now printed as a separate JSON block.

    Before:

    Your Worker has access to the following bindings:
    Binding                               Resource
    env.extra_data ("interesting value")  Unsafe Metadata
    env.more_data ("dubious value")       Unsafe Metadata
    

    After:

    The following unsafe metadata will be attached to your Worker:
    {
      "extra_data": "interesting value",
      "more_data": "dubious value"
    }
    
  • #12463 3388c84 Thanks @petebacondarwin! - Add User-Agent header to remote dev inspector WebSocket connections

    When running wrangler dev --remote, the inspector WebSocket connection now includes a User-Agent header (wrangler/<version>). This resolves issues where WAF rules blocking empty User-Agent headers prevented remote dev mode from working with custom domains.

  • #12421 937425c Thanks @ryanking13! - Fix Python Workers deployment failing on Windows due to path separator handling

    Previously, deploying Python Workers on Windows would fail because the backslash path separator (\) was not properly handled, causing the entire full path to be treated as a single filename. The deployment process now correctly normalizes paths to use forward slashes on all platforms.

  • Updated dependencies [2d90127, 555b32a, d636d6a, bf8df0c, 312b5eb, ce9dc01]:

4.63.0

Minor Changes

  • #12386 447daa3 Thanks @NuroDev! - Added new "open local explorer" hotkey for experimental/WIP local resource explorer

    When running wrangler dev with the experimental local explorer feature enabled, you can now press the e hotkey to open the local resource explorer UI in your browser.

Patch Changes

  • #11350 ee9b81f Thanks @dario-piotrowicz! - fix: improve error message when the entrypoint is incorrect

    Error messages for incorrect entrypoint configuration have been improved to provide clearer and more actionable feedback. The updated messages help users understand what went wrong and how to fix their configuration.

  • #12402 63f1adb Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260131.0 1.20260203.0
  • #12418 ba13de9 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260203.0 1.20260205.0
  • #12216 fe3af35 Thanks @ichernetsky-cf! - Deprecate 'wrangler cloudchamber apply' in favor of 'wrangler deploy'

  • #12368 bd4bb98 Thanks @KianNH! - Preserve Containers configuration when using versions commands

    Previously, commands like wrangler versions upload would inadvertently disable Containers on associated Durable Object namespaces because the containers property was being omitted from the API request body.

  • #12396 dab4bc9 Thanks @petebacondarwin! - fix: redact email addresses and account names in non-interactive mode

    To prevent sensitive information from being exposed in public CI logs, email addresses and account names are now redacted when running in non-interactive mode (e.g., CI environments). Account IDs remain visible to aid debugging.

  • #12378 18c0784 Thanks @X6TXY! - Truncate Pages commit messages at UTF-8 boundaries to avoid invalid UTF-8

  • Updated dependencies [63f1adb, ba13de9, 83adb2c]:

4.62.0

Minor Changes

  • #12064 964a39d Thanks @G4brym! - Add AI Search OAuth scopes to login

    Adds ai-search:write and ai-search:run OAuth scopes to the default login scopes, enabling wrangler to authenticate with AI Search APIs.

  • #11867 253a85d Thanks @rahulsuresh-git! - Add wrangler r2 bucket local-uploads command to manage local uploads for R2 buckets

    When enabled, object data is written to the nearest region first, then asynchronously replicated to the bucket's primary region.

    Docs: https://developers.cloudflare.com/r2/buckets/local-uploads

    # Get local uploads status
    wrangler r2 bucket local-uploads get my-bucket
    
    # Enable local uploads (will prompt for confirmation)
    wrangler r2 bucket local-uploads enable my-bucket
    
    # Enable without confirmation prompt
    wrangler r2 bucket local-uploads enable my-bucket --force
    
    # Disable local uploads
    wrangler r2 bucket local-uploads disable my-bucket
    
  • #11803 1bd1488 Thanks @dario-piotrowicz! - Add a new subrequests limit to the limits field of the Wrangler configuration file

    Before only the cpu_ms limit was supported in the limits field of the Wrangler configuration file, now a subrequests limit can be specified as well which enables the user to limit the number of fetch requests that a Worker's invocation can make.

    Example:

    {
      "$schema": "./node_modules/wrangler/config-schema.json",
      "limits": {
        "cpu_ms": 1000,
        "subrequests": 150 // newly added field
      }
    }
    
  • #12185 f7aa8c7 Thanks @penalosa! - Add timestamp field to the version metadata binding in local development. The version metadata binding now includes id, tag, and timestamp fields, making it easier to test version-aware logic locally.

Patch Changes

  • #12190 ce736b9 Thanks @dario-piotrowicz! - Update autoconfig logic to handle Next.js projects by using the new @opennextjs/cloudflare migrate command

  • #12065 47944d1 Thanks @langningchen! - Improve error message when d1 export --output points to a directory

  • #12292 4c4d5a5 Thanks @dario-piotrowicz! - Add versionCommand to the autoconfig_summary field in the autoconfig output entry

    Add the version upload command to the output being printed by wrangler deploy to WRANGLER_OUTPUT_FILE_DIRECTORY/WRANGLER_OUTPUT_FILE_PATH. This complements the existing buildCommand and deployCommand fields and allows CI systems to know how to upload new versions of Workers.

    For example, for a standard npm project this would be:

    • Version command: npx wrangler versions upload

    While for a Next.js project it would be:

    • Version command: npx @opennextjs/cloudflare upload
  • #12050 b05b919 Thanks @NuroDev! - Fixed Wrangler's error handling for both invalid commands with and without the --help flag, ensuring consistent and clear error messages.

    Additionally, it also ensures that if you provide an invalid argument to a valid command, Wrangler will now correctly display that specific commands help menu.

  • #12289 0aaf080 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260128.0 1.20260129.0
  • #12295 b981db5 Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260129.0 1.20260130.0
  • #12355 a113c0d Thanks @dependabot! - Update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260130.0 1.20260131.0
  • #11971 fdd7a9f Thanks @dario-piotrowicz! - Add framework id, build command, and deploy command to the autoconfig_summary field in the deploy output entry

    Add the framework id alongside the commands to build and deploy the project to the output being printed by wrangler deploy to WRANGLER_OUTPUT_FILE_DIRECTORY or WRANGLER_OUTPUT_FILE_PATH.

    For example for an npm Astro project these would be:

    • Framework id: astro
    • Build command: npm run build
    • Deploy command: npx wrangler deploy

    While for a Next.js project they would instead be:

    • Framework id: next
    • Build command: npx @opennextjs/cloudflare build
    • Deploy command: npx @opennextjs/cloudflare deploy
  • #12211 a5fca2c Thanks @elithrar! - Remove the 'pubsub' sub-command and related functionality

    The Pub/Sub product was never made publicly available and has been discontinued. This removes the wrangler pubsub command and all associated functionality.

  • Updated dependencies [0c9625a, 0aaf080, b981db5, a113c0d, f7aa8c7]:

4.61.1

Patch Changes

  • #12189 eb8a415 Thanks @NuroDev! - Fixed Durable Object missing migrations warning message.

    If a Workers project includes some durable_objects in it but no migrations we show a warning to the user to add migrations to their config. However, this warning recommended new_classes for their migrations, but we instead now recommend all users use new_sqlite_classes instead.

  • #11804 3b06b18 Thanks @emily-shen! - fix: allow d1 execute, d1 export, and d1 migrations to work locally without database_id in config.

  • #12183 17961bb Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260124.0 1.20260127.0
  • #12196 52fdfe7 Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260127.0 1.20260128.0
  • #12199 6d8d9cd Thanks @petebacondarwin! - Prevent wrangler logout from failing when the Wrangler configuration file is invalid

    Previously, if your wrangler.toml or wrangler.json file contained syntax errors or invalid values, the wrangler logout command would fail. Now, configuration parsing errors are caught and logged at debug level, allowing you to log out regardless of the state of your configuration file.

  • #12153 cb72c11 Thanks @petebacondarwin! - Sanitize commands and arguments in telemetry to prevent accidentally capturing sensitive information.

    Changes:

    • Renamed telemetry fields from command/args to sanitizedCommand/sanitizedArgs to distinguish from historical fields that may have contained sensitive data in older versions
    • Command names now come from command definitions rather than user input, preventing accidental capture of sensitive data pasted as positional arguments
    • Sentry breadcrumbs now use the safe command name from definitions
    • Argument values are only included if explicitly allowed via COMMAND_ARG_ALLOW_LIST
    • Argument keys (names) are always included since they come from command definitions, not user input
  • Updated dependencies [8a210af, 17961bb, 52fdfe7, 5f060c9]:

4.61.0

Minor Changes

  • #12008 e414f05 Thanks @penalosa! - Add support for customising the inspector IP address

    Adds a new --inspector-ip CLI flag and dev.inspector_ip configuration option to allow customising the IP address that the inspector server listens on. Previously, the inspector was hardcoded to listen only on 127.0.0.1.

    Example usage:

    # CLI flag
    wrangler dev --inspector-ip 0.0.0.0
    
    // wrangler.json
    {
      "dev": {
        "inspector_ip": "0.0.0.0"
      }
    }
    
  • #12034 05714f8 Thanks @emily-shen! - Add a no-op local explorer worker, which is gated by the experimental flag X_LOCAL_EXPLORER.

Patch Changes

  • #12134 a0a9ef6 Thanks @NuroDev! - Fixed Fish shell tab completions.

    The wrangler tab completions are powered by @bomb.sh/tab which has been upgraded to version 0.0.12 which includes a fix for the Fish shell which was previously not working at all.

  • #12006 ad4666c Thanks @penalosa! - Remove --use-remote option from wrangler hyperdrive create command

    Hyperdrive does not support remote bindings during local development - it requires a localConnectionString to connect to a local database. This change removes the confusing "remote resource" prompt that was shown when creating a Hyperdrive config.

    Fixes #11674

  • #11853 014e7aa Thanks @43081j! - Use built-in stripVTControlCharacters utility rather than the strip-ansi package.

  • #12040 77e82d2 Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260120.0 1.20260122.0
  • #12061 f08ef21 Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260122.0 1.20260123.0
  • #12088 0641e6c Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260123.0 1.20260124.0
  • #12044 eacedba Thanks @edmundhung! - Fix wrangler secret list to error when the Worker is not found

    Previously, running wrangler secret list against a non-existent Worker would silently return an empty array, making it difficult to diagnose issues like being logged into the wrong account. It now returns an error with suggestions for common causes.

  • #12150 e8b2ef5 Thanks @dario-piotrowicz! - Emit autoconfig summary as a separate output entry

    Move the autoconfig summary from the deploy output entry to a dedicated autoconfig output entry type. This entry is now emitted by both wrangler deploy and wrangler setup commands when autoconfig runs, making it easier to track autoconfig results independently of deployments.

  • Updated dependencies [014e7aa, e414f05, 77e82d2, f08ef21, 0641e6c, 05714f8, bbd8a5e]:

4.60.0

Minor Changes

  • #11113 bba0968 Thanks @AmirSa12! - Add wrangler complete command for shell completion scripts (bash, zsh, powershell)

    Usage:

    # Bash
    wrangler complete bash >> ~/.bashrc
    
    # Zsh
    wrangler complete zsh >> ~/.zshrc
    
    # Fish
    wrangler complete fish >> ~/.config/fish/completions/wrangler.fish
    
    # PowerShell
    wrangler complete powershell > $PROFILE
    
    • Uses @bomb.sh/tab library for cross-shell compatibility
    • Completions are dynamically generated from experimental_getWranglerCommands() API
  • #11893 f9e8a45 Thanks @NuroDev! - wrangler types now generates per-environment TypeScript interfaces when named environments exist in your configuration.

    When your configuration has named environments (an env object), wrangler types now generates both:

    • Per-environment interfaces (e.g., StagingEnv, ProductionEnv) containing only the bindings explicitly declared in each environment, plus inherited secrets
    • An aggregated Env interface with all bindings from all environments (top-level + named environments), where:
      • Bindings present in all environments are required
      • Bindings not present in all environments are optional
      • Secrets are always required (since they're inherited everywhere)
      • Conflicting binding types across environments produce union types (e.g., KVNamespace | R2Bucket)

    However, if your config does not contain any environments, or you manually specify an environment via --env, wrangler types will continue to generate a single interface as before.

    Example:

    Given the following wrangler.jsonc:

    {
      "name": "my-worker",
      "kv_namespaces": [
        {
          "binding": "SHARED_KV",
          "id": "abc123"
        }
      ],
      "env": {
        "staging": {
          "kv_namespaces": [
            { "binding": "SHARED_KV", "id": "staging-kv" },
            { "binding": "STAGING_CACHE", "id": "staging-cache" }
          ]
        }
      }
    }
    

    Running wrangler types will generate:

    declare namespace Cloudflare {
      interface StagingEnv {
        SHARED_KV: KVNamespace;
        STAGING_CACHE: KVNamespace;
      }
      interface Env {
        SHARED_KV: KVNamespace; // Required: in all environments
        STAGING_CACHE?: KVNamespace; // Optional: only in staging
      }
    }
    interface Env extends Cloudflare.Env {}
    

Patch Changes

  • #12030 614bbd7 Thanks @jbwcloudflare! - Fix wrangler pages project validate to respect file count limits from CF_PAGES_UPLOAD_JWT

  • #11993 788bf78 Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260116.0 1.20260120.0
  • #12039 1375577 Thanks @dimitropoulos! - Fixed the flag casing for the time period flag for the d1 insights command.

  • #12026 c3407ad Thanks @dario-piotrowicz! - Fix wrangler setup not automatically selecting workers as the target for new SvelteKit apps

    The Sveltekit adapter:cloudflare adapter now accepts two different targets workers or pages. Since the wrangler auto configuration only targets workers, wrangler should instruct the adapter to use the workers variant. (The auto configuration process would in any case not work if the user were to target pages.)

  • Updated dependencies [788bf78, ae108f0]:

4.59.3

Patch Changes

  • #9396 75386b1 Thanks @gnekich! - Fix wrangler login with custom callback-host/callback-port

    The Cloudflare OAuth API always requires the redirect_uri to be localhost:8976. However, sometimes the Wrangler OAuth server needed to listen on a different host/port, for example when running from inside a container. We were previously incorrectly setting the redirect_uri to the configured callback host/port, but it needs to be up to the user to map localhost:8976 to the Wrangler OAuth server in the container.

    Example:

    You might run Wrangler inside a docker container like this: docker run -p 8989:8976 <image>, which forwards port 8976 on your host to 8989 inside the container.

    Then inside the container, run wrangler login --callback-host=0.0.0.0 --callback-port=8989

    The OAuth link still has a redirect_uri set tolocalhost:8976. For example https://dash.cloudflare.com/oauth2/auth?...&redirect_uri=http%3A%2F%2Flocalhost%3A8976%2Foauth%2Fcallback&...

    However the redirect to localhost:8976 is then forwarded to the Wrangler OAuth server inside your container, allowing the login to complete.

  • #11925 8e4a0e5 Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260114.0 1.20260115.0
  • #11942 133bf95 Thanks @penalosa! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260115.0 1.20260116.0
  • #11922 93d8d78 Thanks @dario-piotrowicz! - Improve telemetry errors being sent to Sentry by wrangler init when it delegates to C3 by ensuring that they contain the output of the C3 execution.

  • #11940 69ff962 Thanks @penalosa! - Show helpful messages for file not found errors (ENOENT)

    When users encounter file not found errors, Wrangler now displays a helpful message with the missing file path and common causes, instead of reporting to Sentry.

  • #11904 22727c2 Thanks @danielrs! - Fix false positive infinite loop detection for exact path redirects

    Fixed an issue where the redirect validation incorrectly flagged exact path redirects like / /index.html 200 as infinite loops. This was particularly problematic when html_handling is set to "none", where such redirects are valid.

    The fix makes the validation more specific to only block wildcard patterns (like /* /index.html) that would actually cause infinite loops, while allowing exact path matches that are valid in certain configurations.

    Fixes: https://github.com/cloudflare/workers-sdk/issues/11824

  • #11946 fa39a73 Thanks @MattieTK! - Fix configFileName returning wrong filename for .jsonc config files

    Previously, users with a wrangler.jsonc config file would see error messages and hints referring to wrangler.json instead of wrangler.jsonc. This was because the configFormat function collapsed both .json and .jsonc files into a single "jsonc" value, losing the distinction between them.

    Now configFormat returns "json" for .json files and "jsonc" for .jsonc files, allowing configFileName to return the correct filename for each format.

  • #11968 4ac7c82 Thanks @MattieTK! - fix: include version components in command event metrics

    Adds wranglerMajorVersion, wranglerMinorVersion, and wranglerPatchVersion to command events (wrangler command started, wrangler command completed, wrangler command errored). These properties were previously only included in adhoc events.

  • #11940 69ff962 Thanks @penalosa! - Improve error message when creating duplicate KV namespace

    When attempting to create a KV namespace with a title that already exists, Wrangler now provides a clear, user-friendly error message instead of the generic API error. The new message explains that the namespace already exists and suggests running wrangler kv namespace list to see existing namespaces with their IDs, or choosing a different namespace name.

  • #11962 029531a Thanks @dario-piotrowicz! - Cache chosen account in memory to avoid repeated prompts

    When users have multiple accounts and no node_modules directory exists for file caching, Wrangler (run via npx and equivalent commands) would prompt for account selection multiple times during a single command. Now the selected account is also stored in process memory, preventing duplicate prompts and potential issues from inconsistent account choices.

  • #11964 d58fbd1 Thanks @dario-piotrowicz! - Make name the positional argument for wrangler delete instead of script

    The script argument was meaningless for the delete command since it deletes by worker name, not by entry point path. The name argument is now accepted as a positional argument, allowing users to run wrangler delete my-worker instead of wrangler delete --name my-worker. The script argument is now hidden but still accepted for backwards compatibility.

  • #11967 202c59e Thanks @emily-shen! - chore: update undici

    The following dependency versions have been updated:

    Dependency From To
    undici 7.14.0 7.18.2
  • #11940 69ff962 Thanks @penalosa! - Improve error handling for Vite config transformations

    Replace assertions with proper error handling when transforming Vite configs. When Wrangler encounters a Vite config that uses a function or lacks a plugins array, it now provides clear, actionable error messages instead of crashing with assertion failures. The check function gracefully skips incompatible configs with debug logging.

  • Updated dependencies [8e4a0e5, 133bf95, 202c59e, 133bf95, 25e2c60]:

4.59.2

Patch Changes

  • #11908 e78186d Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260111.0 1.20260114.0
  • #11880 fe4faa3 Thanks @penalosa! - Show helpful messages for errors outside of Wrangler's control. This prevents unnecessary Sentry reports.

    Errors now handled with user-friendly messages:

    • Connection timeouts to Cloudflare's API (UND_ERR_CONNECT_TIMEOUT) - typically due to slow networks or connectivity issues
    • File system permission errors (EPERM, EACCES) - caused by insufficient permissions, locked files, or antivirus software
    • DNS resolution failures (ENOTFOUND) - caused by network connectivity issues or DNS configuration problems
  • #11882 695b043 Thanks @GregBrimble! - Improve the error message for wrangler secret put when using Worker versions or gradual deployments. wrangler versions secret put should be used instead, or ensure to deploy the latest version before using wrangler secret put. wrangler secret put alone will add the new secret to the latest version (possibly undeployed) and immediately deploy that which is usually not intended.

  • Updated dependencies [e78186d, fec8f5b, d39777f, 4714ca1, c17e971]:

4.59.1

Patch Changes

  • #11889 99b1f32 Thanks @emily-shen! - Use argument array when executing git commands with wrangler pages deploy

    Pass user provided values from --commit-hash safely to underlying git command.

4.59.0

Minor Changes

  • #11852 ad65efa Thanks @NuroDev! - Add --check flag to wrangler types command

    The new --check flag allows you to verify that your generated types file is up-to-date without regenerating it. This is useful for CI/CD pipelines, pre-commit hooks, or any scenario where you want to ensure types have been committed after configuration changes.

    When types are up-to-date, the command exits with code 0:

    $ wrangler types --check
    ✨ Types at worker-configuration.d.ts are up to date.
    

    When types are out-of-date, the command exits with code 1:

    $ wrangler types --check
    ✘ [ERROR] Types at worker-configuration.d.ts are out of date. Run `wrangler types` to regenerate.
    

    You can also use it with a custom output path:

    $ wrangler types ./custom-types.d.ts --check
    
  • #11529 43d5363 Thanks @matthewdavidrodgers! - Add ability to enable higher asset count limits for Pages deployments

    Wrangler can now read asset count limits from JWT claims during Pages deployments, allowing users to be enabled for higher limits (up to 100,000 assets) on a per-account basis. The default limit remains at 20,000 assets.

  • #11755 0f8d69d Thanks @nikitassharma! - Users can now specify constraints.tiers for their container applications. tier is deprecated in favor of tiers. If left unset, we will default to tiers: [1, 2]. Note that constraints is an experimental feature.

Patch Changes

  • #11820 b0e54b2 Thanks @MattieTK! - Add AI agent detection to analytics events

    Wrangler now detects when commands are executed by AI coding agents (such as Claude Code, Cursor, GitHub Copilot, etc.) using the am-i-vibing library. This information is included as an agent property in all analytics events, helping Cloudflare understand how developers interact with Wrangler through AI assistants.

    The agent property will contain the agent ID (e.g., "claude-code", "cursor-agent") when detected, or null when running outside an agentic environment.

  • #11494 ed60c4f Thanks @jalmonter! - Fix scheduled trigger warning showing undefined port

    When running wrangler dev with a worker that has cron triggers, the warning message displayed an invalid URL like curl "http://localhost:undefined/cdn-cgi/handler/scheduled" because the port wasn't yet determined when the warning was logged.

    Moved the warning to after the proxy server is fully ready, where the actual public URL and port are known.

  • #11831 faa5753 Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260107.1 1.20260108.0
  • #11844 e574ef3 Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260108.0 1.20260109.0
  • #11872 b6148ed Thanks @dependabot! - chore: update dependencies of "miniflare", "wrangler"

    The following dependency versions have been updated:

    Dependency From To
    workerd 1.20260109.0 1.20260111.0
  • #11843 ab3859c Thanks @dario-piotrowicz! - Update the Wrangler autoconfig logic to work with the latest version of Waku

    The latest version of Waku (0.12.5-1.0.0-alpha.1-0) requires a src/waku.server.tsx file instead of a src/server-entry.tsx one, so the Wrangler autoconfig logic (the logic being run as part of wrangler setup and wrangler deploy --x-autoconfig that configures a project to be deployable on Cloudflare) has been updated accordingly.

    Also the way the worker needs to handle static assets has been updated as recommended from the Waku team.

  • #11848 0eb973d Thanks @petebacondarwin! - Fix incorrect warning about multiple environments when using redirected config

    Previously, when using a redirected config (via configPath in another config file) that originated from a config with multiple environments, wrangler would incorrectly warn about missing environment specification. This fix ensures the warning is only shown when the actual config being used has multiple environments defined, not when the original config did.

  • Updated dependencies [ed60c4f, 5c59217, faa5753, e574ef3, b6148ed, beb96af, 5c59217, fc96e5f]:

4.58.0

Minor Changes

  • #11728 7d63fa5 Thanks @NuroDev! - Add command categories to wrangler help menu

    The help output now groups commands by product category (Account, Compute & AI, Storage & Databases, Networking & Security) to match the Cloudflare dashboard organization:

    $ wrangler --help
    
    COMMANDS
      wrangler docs [search..]  📚 Open Wrangler's command documentation in your browser
    
    ACCOUNT
      wrangler auth    🔓 Manage authentication
      wrangler login   🔑 Login to Cloudflare
      ...
    
    COMPUTE & AI
      wrangler ai          🤖 Manage AI models
      wrangler containers  📦 Manage Containers [open beta]
      ...
    

    This improves discoverability by organizing the 20+ wrangler commands into logical groups.

Patch Changes

4.57.0

Minor Changes

  • #11682 b993d95 Thanks @ascorbic! - Add wrangler auth token command to retrieve your current authentication credentials.

    You can now retrieve your authentication token for use with other tools and scripts:

    wrangler auth token
    

    The command returns whichever authentication method is currently configured:

    • OAuth token from wrangler login (automatically refreshed if expired)
    • API token from CLOUDFLARE_API_TOKEN environment variable

    Use --json to get structured output including the token type, which also supports API key/email authentication:

    wrangler auth token --json
    

    This is similar to gh auth token in the GitHub CLI.

  • #11702 f612b46 Thanks @gpanders! - Add support for trusted_user_ca_keys in Wrangler

    You can now configure SSH trusted user CA keys for containers. Add the following to your wrangler.toml:

    [[containers.trusted_user_ca_keys]]
    public_key = "ssh-ed25519 AAAAC3..."
    

    This allows you to specify CA public keys that can be used to verify SSH user certificates.

  • #11437 9e360f6 Thanks @ichernetsky-cf! - Drop deprecated containers observability.logging field

  • #11616 fc95831 Thanks @NuroDev! - Add type generation support to wrangler dev

    You can now have your worker configuration types be automatically generated when the local Wrangler development server starts.

    To use it you can either:

    1. Add the --types flag when running wrangler dev.
    2. Update your Wrangler configuration file to add the new dev.generate_types boolean property.
    {
      "$schema": "node_modules/wrangler/config-schema.json",
      "name": "example",
      "main": "src/index.ts",
      "compatibility_date": "2025-12-12",
      "dev": {
        "generate_types": true
      }
    }
    
  • #11524 b0dbf1a Thanks @penalosa! - Add hidden CLI flags to wrangler setup for suppressing output

    Two new hidden flags have been added to wrangler setup:

    • --no-completion-message: Suppresses the deployment details message after setup completes
    • --no-install-wrangler: Skips Wrangler installation during project setup
  • #11777 69979a3 Thanks @MattieTK! - Add analytics properties to secret commands for better usage insights

    Secret commands (wrangler secret put, wrangler secret bulk, and their Pages/versions equivalents) now include additional analytics properties to help understand how secrets are being managed:

    • secretOperation: Whether this is a "single" or "bulk" secret operation
    • secretSource: How the secret was provided ("interactive", "stdin", or "file")
    • secretFormat: For bulk operations, the format used ("json" or "dotenv")
    • hasEnvironment: Whether an environment was specified

    These properties help improve the developer experience by understanding common usage patterns. No sensitive information (secret names, values, or counts) is tracked.

  • #11738 c54f8da Thanks @jamesopstad! - Add default Text module rule for .sql files.

    This enables importing .sql files directly in Wrangler and the Cloudflare Vite plugin without extra configuration.

  • #11692 df1f9c9 Thanks @dario-piotrowicz! - Support Waku in autoconfig

  • #11549 d059f69 Thanks @dario-piotrowicz! - Support Vike in autoconfig

Patch Changes

  • #11683 02fbd22 Thanks @ascorbic! - Display a warning when authentication errors occur and the account_id in your Wrangler configuration does not match any of your authenticated accounts. This helps identify configuration issues where you may have the wrong account ID set in your wrangler.toml or wrangler.jsonc file.

  • #11704 77078ef Thanks @dario-piotrowicz! - Fix autoconfig handling of Next.js apps with CJS config files and incompatible Next.js versions

    Previously, wrangler setup and wrangler deploy --x-autoconfig would fail when working with Next.js applications that use CommonJS config files (next.config.cjs) or have versions of Next.js that don't match the required peer dependencies. The autoconfig process now uses dynamic imports and forced installation to handle these scenarios gracefully.

  • #11796 2510723 Thanks @dario-piotrowicz! - wrangler deploy delegates to opennextjs-cloudflare deploy only when the --x-autoconfig flag is used

    The wrangler deploy command has been updated to delegate to the opennextjs-cloudflare deploy command when run in an open-next project. Once this behavior had been introduced it caused a few issues. So it's been decided to enable it for the time being only when the --x-autoconfig flag is set (since this behavior, although generally valid, is only strictly necessary for the wrangler deploy's autoconfig flow).

  • #11764 9f6dd71 Thanks @terakoya76! - Fix R2 Data Catalog snapshot-expiration API field names

    The wrangler r2 bucket catalog snapshot-expiration enable command was sending incorrect field names to the Cloudflare API, resulting in a 422 Unprocessable Entity error. This fix updates the API request body to use the correct field names:

    • olderThanDays -> max_snapshot_age (as duration string, e.g., "30d")
    • retainLast -> min_snapshots_to_keep

    The CLI options (--older-than-days and --retain-last) remain unchanged.

  • #11651 d123ad0 Thanks @dario-piotrowicz! - Surface a more helpful error message for TOML Date, Date-Time, and Time values in vars

    TOML parses unquoted date/time values like DATE = 2024-01-01 as objects. Previously this would cause an unhelpful error message further down the stack. Now wrangler surfaces a more helpful error message earlier, telling you to quote the value as a string, e.g. DATE = "2024-01-01".

  • #11711 5121b23 Thanks @southpolesteve! - Show an error when D1 migration commands are run without a configuration file

    Previously, running wrangler d1 migrations apply, wrangler d1 migrations list, or wrangler d1 migrations create in a directory without a Wrangler configuration file would silently exit with no feedback. Now these commands display a clear error message:

    "No configuration file found. Create a wrangler.jsonc file to define your D1 database."

  • #11710 82e7e90 Thanks @dario-piotrowicz! - Fix arguments passed to wrangler deploy not being forwarded to opennextjs-cloudflare deploy

    wrangler deploy run in an open-next project delegates to opennextjs-cloudflare deploy, as part of this all the arguments passed to wrangler deploy need be forwarded to opennextjs-cloudflare deploy, before the arguments would be lost, now they will be successfully forwarded (for example wrangler deploy --keep-vars will call opennextjs-cloudflare deploy --keep-vars)

  • #10750 4688f59 Thanks @jacoblearned! - Notify user on local dev server reload.

    When running wrangler dev, the local server suppresses Miniflare's reload messages to prevent duplicate log entries from the proxy and user workers. This update adds a reload complete message so users know their changes were applied, instead of only seeing "Reloading local server...".

  • #11673 b827893 Thanks @MattieTK! - Breaks out version numbers into sortable number types for analytics logging

  • Updated dependencies [65d1850, 1615fce, b2769bf, 554a4df, 8eede3f, 6a05b1c, 62fd118, a7e9f80, eac5cf7]:

4.56.0

Minor Changes

  • #11196 171cfd9 Thanks @emily-shen! - For containers being created in a FedRAMP high environment, registry credentials are encrypted by the container platform. Update wrangler to correctly send a request to configure a registry for FedRAMP containers.

  • #11646 472cf72 Thanks @vovacf201! - feat: add R2 Data Catalog snapshot expiration commands

    Adds new commands to manage automatic snapshot expiration for R2 Data Catalog tables:

    • wrangler r2 bucket catalog snapshot-expiration enable - Enable automatic snapshot expiration
    • wrangler r2 bucket catalog snapshot-expiration disable - Disable automatic snapshot expiration

    Snapshot expiration helps manage storage costs by automatically removing old table snapshots while keeping a minimum number of recent snapshots for recovery purposes.

    Example usage:

    # Enable snapshot expiration for entire catalog (keep 10 snapshots, expire after 5 days)
    wrangler r2 bucket catalog snapshot-expiration enable my-bucket --token $R2_CATALOG_TOKEN --max-age 7200 --min-count 10
    
    # Enable for specific table
    wrangler r2 bucket catalog snapshot-expiration enable my-bucket my-namespace my-table --token $R2_CATALOG_TOKEN --max-age 2880 --min-count 5
    
    # Disable snapshot expiration
    wrangler r2 bucket catalog snapshot-expiration disable my-bucket
    

Patch Changes

  • #11649 428ae9e Thanks @ascorbic! - fix: respect TypeScript path aliases when resolving non-JS modules with module rules

    When importing non-JavaScript files (like .graphql, .txt, etc.) using TypeScript path aliases defined in tsconfig.json, Wrangler's module-collection plugin now correctly resolves these imports. Previously, path aliases were only respected for JavaScript/TypeScript files, causing imports like import schema from '~lib/schema.graphql' to fail when using module rules.

  • #11647 c0e249e Thanks @dario-piotrowicz! - The auto-configuration logic present in wrangler setup and wrangler deploy --x-autoconfig cannot reliably handle Hono projects, so in these cases make sure to properly error saying that automatically configuring such projects is not supported.

  • #11694 3853200 Thanks @dario-piotrowicz! - fix: improve the open-next detection that wrangler deploy performs to eliminate false positives for non open-next projects

  • Updated dependencies [ae1ad22, 737c0f4]:

4.55.0

Minor Changes

Patch Changes

  • #11615 ed42010 Thanks @elithrar! - Add helpful warning when SSL certificate errors occur due to corporate proxies or VPNs intercepting HTTPS traffic. When errors like "self-signed certificate in certificate chain" are detected, wrangler now displays guidance about installing missing system roots from your corporate proxy vendor.

  • #11641 6b28de1 Thanks @petebacondarwin! - update command status text and formatting

  • #11578 4201472 Thanks @gpanders! - Fixup UX papercuts in containers SSH

  • #11550 95d81e1 Thanks @hiendv! - Fix "TypeError: Body is unusable: Body has already been read" when failing to exchange oauth code because of double response.text().

  • Updated dependencies [5d085fb, b75b710, 1e9be12]:

4.54.0

Minor Changes

  • #11512 c15e99e Thanks @emily-shen! - Enable using ctx.exports with containers

    You can now use containers with Durable Objects that are accessed via ctx.exports.

    Now your config file can look something like this:

    {
    	"name": "container-app",
    	"main": "src/index.ts",
    	"compatibility_date": "2025-12-01",
    	"compatibility_flags": ["enable_ctx_exports"], // compat flag needed for now.
    	"containers": [
    		{
    			"image": "./Dockerfile",
    			"class_name": "MyDOClassname",
    			"name": "my-container"
    		},
    	],
    	"migrations": [
    		{
    			"tag": "v1",
    			"new_sqlite_classes": ["MyDOClassname"],
    		},
    	],
    	// no need to declare your durable object binding here
    }
    

    Note that when using ctx.exports, where you previously accessed a Durable Object via something like env.DO, you should now access with ctx.exports.MyDOClassname.

    Refer to the docs for more information on using ctx.exports.

  • #11508 b17797c Thanks @dario-piotrowicz! - Wrangler will no longer try to add additional configuration to projects using @cloudflare/vite-plugin when deploying or running wrangler setup

  • #11508 b17797c Thanks @dario-piotrowicz! - When a Vite project is detected, install @cloudflare/vite-plugin

  • #11576 bb47e20 Thanks @dario-piotrowicz! - Support Analog projects in autoconfig

  • #10582 991760d Thanks @flakey5! - Add containers ssh command

Patch Changes

4.53.0

Minor Changes

  • #11500 af54c63 Thanks @dario-piotrowicz! - Add new autoconfig_summary field to the deploy output entry

    This change augments wrangler deploy output being printed to WRANGLER_OUTPUT_FILE_DIRECTORY or WRANGLER_OUTPUT_FILE_PATH to also include a new autoconfig_summary field containing the possible summary details for the autoconfig process (the field is undefined if autoconfig didn't run).

    Note: the field is experimental and could change while autoconfig is not GA

  • #11477 9988cc9 Thanks @ascorbic! - Support Nuxt in autoconfig

  • #11472 ce295bf Thanks @dario-piotrowicz! - Support Qwik projects in autoconfig

  • #10937 9514c9a Thanks @ReppCodes! - Add support for "targeted" placement mode with region, host, and hostname fields

    This change adds a new mode to placement configuration. You can specify one of the following fields to target specific external resources for Worker placement:

    • region: Specify a region identifier (e.g., "aws:us-east-1") to target a region from another cloud service provider
    • host: Specify a host with (required) port (e.g., "example.com:8123") to target a TCP service
    • hostname: Specify a hostname (e.g., "example.com") to target an HTTP resource

    These fields are mutually exclusive - only one can be specified at a time.

    Example configuration:

    [placement]
    host = "example.com:8123"
    
  • #11498 ac861f8 Thanks @penalosa! - Add React Router support in autoconfig

  • #11506 79d30d4 Thanks @vicb! - Set the target JS version to ES2024

Patch Changes

4.52.1

Patch Changes

4.52.0

Minor Changes

  • #11416 abe49d8 Thanks @dario-piotrowicz! - Remove the wrangler deploy's --x-remote-diff-check experimental flag

    The remote diffing feature has been enabled by default for a while and its functionality is stable, as a result the experimental flag (only available for option-out of the feature right now) has been removed.

  • #11408 f29e699 Thanks @ascorbic! - Export unstable helpers useful for generating wrangler config

  • #11389 2342d2f Thanks @dario-piotrowicz! - Improve the wrangler deploy flow to also check for potential overrides of secrets.

    Now when you run wrangler deploy Wrangler will check the remote secrets for your workers for conflicts with the names of the bindings you're about to deploy. If there are conflicts, Wrangler will warn you and ask you for your permission before proceeding.

  • #11375 9a1de61 Thanks @penalosa! - Support TanStack Start in autoconfig

  • #11360 6b38532 Thanks @emily-shen! - Containers: Allow users to directly authenticate external image registries in local dev

    Previously, we always queried the API for stored registry credentials and used those to pull images. This means that if you are using an external registry (ECR, dockerhub) then you have to configure registry credentials remotely before running local dev.

    Now you can directly authenticate with your external registry provider (using docker login etc.), and Wrangler or Vite will be able to pull the image specified in the containers.image field in your config file.

    The Cloudflare-managed registry (registry.cloudflare.com) currently still does not work with the Vite plugin.

  • #11009 e4ddbc2 Thanks @dario-piotrowicz! - Allow users to provide an account_id as part of the WorkerConfigObject they pass to maybeStartOrUpdateRemoteProxySession

  • #11478 2aec2b4 Thanks @dario-piotrowicz! - Support SolidStart in autoconfig

  • #11330 5a873bb Thanks @dario-piotrowicz! - Support Angular projects in autoconfig

  • #11449 e7b690b Thanks @penalosa! - Delegate generation of HTTPS certificates to Miniflare

  • #11448 2b4813b Thanks @edmundhung! - Bumps esbuild version to 0.27.0

  • #11335 c47ad11 Thanks @dario-piotrowicz! - Support internal-only undocumented cross_account_grant service binding property

  • #11346 a977701 Thanks @penalosa! - We're soon going to make backend changes that mean that wrangler dev --remote sessions will no longer have an associated inspector connection. In advance of these backend changes, we've enabled a new wrangler tail-based logging strategy for wrangler dev --remote. For now, you can revert to the previous logging strategy with wrangler dev --remote --no-x-tail-logs, but in future it will not be possible to revert.

    The impact of this will be that logs that were previously available via devtools will now be provided directly to the Wrangler console and it will no longer be possible to interact with the remote Worker via the devtools console.

Patch Changes

  • #11397 b154de2 Thanks @vicb! - Use more workerd native modules

    Node modules punycode, trace_events, cluster, wasi, and domains will be used when enabled via a compatibility flag or by default when the compatibility date is greater or equal to 2025-12-04.

  • #11452 76f0540 Thanks @penalosa! - Remove uses of eval() from the Wrangler bundle

  • #11284 695fa25 Thanks @dom96! - Removes duplicate module warnings when vendoring Python packages

  • #11249 504e258 Thanks @dario-piotrowicz! - fix: Generalize autoconfig wording

    Generalize the autoconfig wording so that when it doesn't specifically mention "deployment" (since it can be run via wrangler setup or the autoconfig programmatic API)

  • #11455 d25f7e2 Thanks @dario-piotrowicz! - Fix autoconfig using absolute paths for static projects

    Running the experimental autoconfig logic through wrangler setup and wrangler deploy --x-autoconfig on a static project results in absolute paths being used. This is incorrect, especially when such paths are being included in the generated wrangler.jsonc. The changes here fix the autoconfig logic to use paths relative to the project's root instead.

    For example given a project located in /Users/usr/projects/sites/my-static-site, before:

    // wrangler.jsonc at /Users/usr/projects/sites/my-static-site
      {
        "$schema": "node_modules/wrangler/config-schema.json",
        "name": "static",
        "compatibility_date": "2025-11-27",
        "observability": {
          "enabled": true
        },
        "assets": {
          "directory": "/Users/usr/projects/sites/my-static-site/public"
        }
      }
    

    and after:

    // wrangler.jsonc at /Users/usr/projects/sites/my-static-site
      {
        "$schema": "node_modules/wrangler/config-schema.json",
        "name": "static",
        "compatibility_date": "2025-11-27",
        "observability": {
          "enabled": true
        },
        "assets": {
          "directory": "public"
        }
      }
    
  • #11484 1cfae2d Thanks @edmundhung! - Explicitly close FileHandle in wrangler d1 execute to support Node 25

  • #11383 1d685cb Thanks @dario-piotrowicz! - Fix: ensure that when a remote proxy session creation fails a hard error is surfaced to the user (both in wrangler dev and in the programmatic API).

    When using remote bindings, either with wrangler dev or via startRemoteProxySession/maybeStartOrUpdateRemoteProxySession the remote proxy session necessary to connect to the remote resources can fail to be created, this might happen if for example you try to set a binding with some invalid values such as:

    MY_R2: {
    	type: "r2_bucket",
    	bucket_name: "non-existent", // No bucket called "non-existent" exists
    	remote: true,
    },
    

    Before this could go undetected and cause unwanted behaviors such as requests handling hanging indefinitely, now wrangler will instead crash (or throw a hard error ion the programmatic API), clearly indicating that something went wrong during the remote session's creation.

  • #11366 edf896d Thanks @ascorbic! - Use correctly-formatted names when displaying detected framework details

  • #11461 9eaa9e2 Thanks @dario-piotrowicz! - Update the structure of the configure method of autoconfig frameworks

    Update the signature of the configure function of autoconfig frameworks (AutoconfigDetails#Framework), before they would return a RawConfig object to use to update the project's wrangler config file, now they return an object that includes the RawConfig and that can potentially also hold additional data relevant to the configuration.

  • Updated dependencies [2b4813b, b154de2, 5ee3780, 6e63b57, 71ab562, 5e937c1]:

4.51.0

Minor Changes

  • #11345 d524e55 Thanks @penalosa! - Enable experimental support for autoconfig-powered Astro projects

  • #11228 43903a3 Thanks @petebacondarwin! - Support CLOUDFLARE_ENV environment variable for selecting the active environment

    This change enables users to select the environment for commands such as CLOUDFLARE_ENV=prod wrangler versions upload. The --env command line argument takes precedence.

    The CLOUDFLARE_ENV environment variable is mostly used with the @cloudflare/vite-plugin to select the environment for building the Worker to be deployed. This build also generates a "redirected deploy config" that is flattened to only contain the active environment. To avoid accidentally deploying a version that is built for one environment to a different environment, there is an additional check to ensure that if the user specifies an environment in Wrangler it matches the original selected environment from the build.

Patch Changes

4.50.0

Minor Changes

  • #11219 524a6e5 Thanks @Ltadrian! - Implement Hyperdrive binding TLS miniflare proxy. This will allow for wrangler dev hyperdrive bindings to connect to external databases that require TLS.

  • #11233 c922a81 Thanks @emily-shen! - Add containers.unsafe to allow internal users to use additional container features

Patch Changes

  • #11353 0cf696d Thanks @vicb! - Use the native node:domain module when available

    It is enabled when the enable_nodejs_domain_module compatibility flag is set.

  • #11328 bb44120 Thanks @ascorbic! - Fixes a bug that caused wrangler deploy to hang when deploying SvelteKit sites with experimental autoconfig

  • #11025 4a158e9 Thanks @devin-ai-integration! - Use the native node:wasi module when available

    It is enabled when the enable_nodejs_wasi_module compatibility flag is set.

  • Updated dependencies [0cf696d, 524a6e5, 4a158e9]:

4.49.1

Patch Changes

4.49.0

Minor Changes

  • #10703 c5c4ee5 Thanks @danlapid! - Add support for streaming tail consumers in local dev. This is an experimental new feature that allows you to register a tailStream() handler (compared to the existing tail() handler), which will receive streamed tail events from your Worker (compared to the tail() handler, which only receives batched events after your Worker has finished processing).

  • #11251 7035804 Thanks @penalosa! - When the WRANGLER_HIDE_BANNER environment variable is provided, Wrangler will no longer display a version banner. This applies to all commands.

    For instance, previously running wrangler docs would give the following output:

    > wrangler docs
     ⛅️ wrangler 4.47.0
    ───────────────────
    Opening a link in your default browser: https://developers.cloudflare.com/workers/wrangler/commands/
    

    With WRANGLER_HIDE_BANNER, this is now:

    > WRANGLER_HIDE_BANNER=true wrangler docs
    Opening a link in your default browser: https://developers.cloudflare.com/workers/wrangler/commands/
    
  • #11285 d014fa7 Thanks @vicb! - Implement the wrangler r2 bulk put bucket-name --filename list.json command.

    The command uploads multiple objects to an R2 bucket.

    The list of object is provided as a JSON encoded file via --filename. It is a list of key and file (respectively the name and the content for the object).

    [
      { "key": "/path/to/obj", "file": "/path/to/file_1"},
      { "key": "/path/to/other/obj", "file": "/path/to/file_2"},
      // ...
    ]
    

    Uploads are executed concurrently and the level of concurrency can be set via --concurrency.

    The command supports the same options as wrangler r2 object put, minus --file, and --pipe and plus --concurrency

  • #11268 15b8460 Thanks @penalosa! - Support SvelteKit projects in autoconfig

  • #11258 2011b6a Thanks @dario-piotrowicz! - Add --dry-run flag to wrangler setup and also a dryRun option to runAutoConfig

Patch Changes

4.48.0

Minor Changes

  • #11212 3908162 Thanks @dario-piotrowicz! - Add autoconfig changes summary for wrangler deploy --x-autoconfig with the option for users to cancel the operation

  • #11229 14d79f2 Thanks @dario-piotrowicz! - Enables experimental-deploy-remote-diff-check flag by default (the flag is still present for now so that users can turn it off if needed) and improves the remote config diffing logic (to include less noise in the diff presented to the user)

  • #11245 dfc6513 Thanks @vicb! - Change how Wrangler selects default ports for dev sessions.

    If no port is specified, Wrangler now probes the default port and the 10 consecutive ports after it before falling back to a random port. This will help getting a stable port number across dev sessions. Both the http server and inspector ports are affected.

Patch Changes

4.47.0

Minor Changes

  • #11201 5286309 Thanks @avenceslau! - Add wrangler workflows instances restart command

  • #11214 5cf8a39 Thanks @penalosa! - Add the experimental wrangler setup command to run autoconfig outside of the deploy flow.

  • #11187 8abc789 Thanks @dario-piotrowicz! - Add possibility for users to edit their project settings during autoconfig

    When running wrangler deploy --experimental-autoconfig, after the automatic project settings detection Wrangler will now present users the opportunity to customize the auto-detected project's settings

Patch Changes

  • #11143 2d16610 Thanks @FlorentCollin! - Improve the formatting of the D1 execute command to always show the duration in milliseconds with two decimal places.

  • #11178 63defa2 Thanks @ascorbic! - Log a more helpful error when attempting to "r2 object put" a non-existent file

  • #11199 70d3d4a Thanks @penalosa! - Add telemetry to autoconfig

  • #11186 38396ed Thanks @hoodmane! - Removed warning when deploying a Python worker

  • #11024 cdcecfc Thanks @devin-ai-integration! - Use the native node:trace_events module when available

    It is enabled when the enable_nodejs_trace_events_module compatibility flag is set.

  • #11195 e85f965 Thanks @ascorbic! - Ignores .dev.vars if --env-file has been explicitly passed

    Previously, .dev.vars would always be read first, and then any file passed with --env-file would override variables in .dev.vars. This meant there was no way to ignore .dev.vars if you wanted to use a different env file. Now, if --env-file is passed, .dev.vars will be ignored entirely.

  • #11181 88aa707 Thanks @petebacondarwin! - add more logging around Wrangler authentication to help diagnose issues

  • Updated dependencies [dd7d584, 4259256, cdcecfc]:

4.46.0

Minor Changes

  • #11183 240ebeb Thanks @dario-piotrowicz! - expose experimental_getDetailsForAutoConfig and experimental_runAutoConfig APIs that provide respectively the autoconfig detection and execution functionalities

  • #11180 53b0fce Thanks @penalosa! - Detect non-framework static sites

  • #11162 c3ed531 Thanks @dario-piotrowicz! - add a remoteBindings option to getPlatformProxy to allow the disabling of remote bindings

  • #11164 305d7bf Thanks @penalosa! - Implement experimental autoconfig flow for static sites

  • #10605 b55a3c7 Thanks @emily-shen! - Add command to configure credentials for non-Cloudflare container registries

    Note this is a closed/experimental command that will not work without the appropriate account-level capabilities.

  • #11078 5d7c4c2 Thanks @simonha9! - Add jurisdiction support to d1 db creation via command-line argument

Patch Changes

  • #11160 05440a1 Thanks @dario-piotrowicz! - Allows auto-update of the local Wrangler configuration file to match remote configuration when running wrangler deploy --env <TARGET_ENV>

    When running wrangler deploy, with --x-remote-diff-check and after cancelling the deployment due to destructive changes present in the local config file, Wrangler offers to update the Wrangler configuration file to match the remote configuration. This wasn't however enabled when a target environment was specified (via the --env|-e flag). Now this will also apply when an environment is targeted.

  • #11162 c3ed531 Thanks @dario-piotrowicz! - Update the description of the --local flag for the wrangler dev command to clarify that it disables remote bindings, also un-deprecate and un-hide it

  • #11162 c3ed531 Thanks @dario-piotrowicz! - Fix bindings with remote: true being logged as remote when run via wrangler dev --local

  • Updated dependencies [1ae020d]:

4.45.4

Patch Changes

  • #11133 8ffbd17 Thanks @petebacondarwin! - Reduce the amount of arguments being passed in metrics capture.

    Now the argument values that are captured come from an allow list, and can be marked as ALLOW (capture the real value) or REDACT (capture as "").

  • #11033 77ed7e2 Thanks @dario-piotrowicz! - Offer to update the local Wrangler configuration file to match remote configuration when running wrangler deploy

    When running wrangler deploy, with --x-remote-diff-check, Wrangler will display the difference between local and remote configuration. If there would be a destructive change to the remote configuration, the user is given the option to cancel the deployment. In the case where the user does cancel deployment, Wrangler will now also offer to update the local Wrangler configuration file to match the remote configuration.

  • #11139 bb00f9d Thanks @devin-ai-integration! - Updated cron trigger documentation links and improved error message to include instructions for testing cron triggers locally

  • #11135 ed666a1 Thanks @penalosa! - Implement tail-based logging for wrangler dev remote mode, behind the --x-tail-tags flag. This will become the default in the future.

  • #11149 22f25fd Thanks @penalosa! - Add no-op autoconfig logic behind an experimental flag

  • Updated dependencies [90a2566, 14f60e8]:

4.45.3

Patch Changes

  • #11117 6822aaf Thanks @emily-shen! - fix: show local/remote status before D1 command confirmations

    D1 commands (execute, export, migrations apply, migrations list, delete, time-travel) now display whether they're running against local or remote databases before showing confirmation prompts. This prevents confusion about which database will be affected by the operation.

  • #11077 bce8142 Thanks @petebacondarwin! - Ensure that process.env is case-insensitive on Windows

    The object that holds the environment variables in process.env does not care about the case of its keys in Windows. For example, process.env.SystemRoot and process.env.SYSTEMROOT will refer to the same value.

    Previously, when merging fields from .env files we were replacing this native object with a vanilla JavaScript object, that is case-insensitive, and so sometimes environment variables appeared to be missing when in reality they just had different casing.

4.45.2

Patch Changes

  • #11097 55657eb Thanks @penalosa! - Extract internal APIs into a new @cloudflare/workers-utils package

  • #11118 d47f166 Thanks @zebp! - Fix validation of the persist field of observability logs and traces configuration

4.45.1

Patch Changes

  • #10959 d0208fe Thanks @devin-ai-integration! - Fixed conflict between --env and --expires flags in wrangler r2 object put.

    --e now aliases --env only, and NOT --expires.

  • #10915 dbe51c1 Thanks @devin-ai-integration! - Fixed self-bindings (service bindings to the same worker) showing as [not connected] in wrangler dev. Self-bindings now correctly show as [connected] since a worker is always available to itself.

  • #10913 d4f2daf Thanks @devin-ai-integration! - Fixed duplicate warning messages appearing during wrangler dev when configuration changes or state transitions occur

4.45.0

Minor Changes

  • #11030 1a8088a Thanks @penalosa! - Enable automatic resource provisioning by default in Wrangler. This is still an experimental feature, but we're turning on the flag by default to make it easier for people to test it and try it out. You can disable the feature using the --no-x-provision flag. It currently works for R2, D1, and KV bindings.

    To use this feature, add a binding to your config file without a resource ID:

    {
      "kv_namespaces": [{ "binding": "MY_KV" }],
      "d1_databases": [{ "binding": "MY_DB" }],
      "r2_buckets": [{ "binding": "MY_R2" }]
    }
    

    wrangler dev will automatically create these resources for you locally, and when you next run wrangler deploy Wrangler will call the Cloudflare API to create the requested resources and link them to your Worker. They'll stay linked across deploys, and you don't need to add the resource IDs to the config file for future deploys to work. This is especially good for shared templates, which now no longer need to include account-specific resource ID when adding a binding.

Patch Changes

  • #11037 4bd4c29 Thanks @danielrs! - Better Wrangler subdomain defaults warning.

    Improves the warnings that we show users when either worker_dev or preview_urls are missing.

  • #10927 31e1330 Thanks @dom96! - Implements python_modules.excludes wrangler config field

    [python_modules]
    excludes = ["**/*.pyc", "**/__pycache__"]
    
  • #10741 2f57345 Thanks @penalosa! - Remove obsolete --x-remote-bindings flag

  • Updated dependencies [ca6c010]:

4.44.0

Minor Changes

  • #10939 d4b4c90 Thanks @danielrs! - Config preview_urls defaults to workers_dev value.

    Originally, we were defaulting config.preview_urls to true, but we were accidentally enabling Preview URLs for users that only had config.workers_dev=false.

    Then, we set the default value of config.preview_urls to false, but we were accidentally disabling Preview URLs for users that only had config.workers_dev=true.

    Rather than defaulting config.preview_urls to true or false, we default to the resolved value of config.workers_dev. Should result in a clearer user experience.

  • #11027 1a2bbf8 Thanks @jamesopstad! - Statically replace the value of process.env.NODE_ENV with development for development builds and production for production builds if it is not set. Else, use the given value. This ensures that libraries, such as React, that branch code based on process.env.NODE_ENV can be properly tree shaken.

  • #9705 0ee1a68 Thanks @hiendv! - Add params type to Workflow type generation. E.g.

    interface Env {
      MY_WORKFLOW: Workflow<
        Parameters<import("./src/index").MyWorkflow["run"]>[0]["payload"]
      >;
    }
    
  • #10867 dd5f769 Thanks @austin-mc! - Add media binding support

Patch Changes

  • #11018 5124818 Thanks @dario-piotrowicz! - Improve potential errors thrown by startRemoteProxySession by including more information

  • #11019 6643bd4 Thanks @dario-piotrowicz! - Fix observability.logs.persist being flagged as an unexpected field during the wrangler config file validation

  • #10768 8211bc9 Thanks @dario-piotrowicz! - Update logs handling to use the new handleStructuredLogs miniflare option

  • #10997 3bb034f Thanks @nikitassharma! - When either WRANGLER_OUTPUT_FILE_PATH or WRANGLER_OUTPUT_FILE_DIRECTORY are set in the environment, then command failures will append a line to the output file encoding the error code and message, if present.

  • #10986 43503c7 Thanks @emily-shen! - fix: cleanup any running containers again on wrangler dev exit

  • #11000 a6de9db Thanks @jonboulle! - always load container image into local store during build

    BuildKit supports different build drivers. When using the more modern docker-container driver (which is now the default on some systems, e.g. a standard Docker installation on Fedora Linux), it will not automatically load the built image into the local image store. Since wrangler expects the image to be there (e.g. when calling getImageRepoTags), it will thus fail, e.g.:

    ⎔ Preparing container image(s)...
    [+] Building 0.3s (8/8) FINISHED                                                                                                                                                                                                     docker-container:default
    
    [...]
    
    WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
    
    ✘ [ERROR] failed inspecting image locally: Error response from daemon: failed to find image cloudflare-dev/sandbox:f86e40e4: docker.io/cloudflare-dev/sandbox:f86e40e4: No such image
    
    

    Explicitly setting the --load flag (equivalent to -o type=docker) during the build fixes this and should make the build a bit more portable without requiring users to change their default build driver configuration.

  • #10994 d39c8b5 Thanks @pombosilva! - Make Workflows instances list command cursor based

  • #10892 7d0417b Thanks @dario-piotrowicz! - improve the diffing representation for wrangler deploy (run under --x-remote-diff-check)

  • Updated dependencies [36d7054, dd5f769, ee7d710, 8211bc9]:

4.43.0

Minor Changes

Patch Changes

  • #10938 e52d0ec Thanks @penalosa! - Acquire Cloudflare Access tokens for additional requests made during a wrangler dev --remote session

  • #10923 2429533 Thanks @emily-shen! - fix: update docker manifest inspect to use full image registry uri when checking if the image exists remotely

  • #10521 88b5b7f Thanks @penalosa! - Improves the Wrangler auto-provisioning feature (gated behind the experimental flag --x-provision) by:

    • Writing back changes to the user's config file (not necessary, but can make it resilient to binding name changes)
    • Fixing --dry-run, which previously threw an error when your config file had auto provisioned resources
    • Improve R2 bindings display to include the bucket_name from the config file on upload
    • Fixing bindings view for specific versions to not display TOML

4.42.2

Patch Changes

  • #10881 ce832d5 Thanks @garvit-gupta! - Add table-level compaction commands for R2 Data Catalog:

    • wrangler r2 bucket catalog compaction enable <bucket> [namespace] [table]
    • wrangler r2 bucket catalog compaction disable <bucket> [namespace] [table]

    This allows you to enable and disable automatic file compaction for a specific R2 data catalog table.

  • #10888 d0ab919 Thanks @lrapoport-cf! - Clarify that wrangler check startup generates a local CPU profile

  • Updated dependencies [42e256f, 4462bc1]:

4.42.1

Patch Changes

4.42.0

Minor Changes

Patch Changes

4.41.0

Minor Changes

  • #10507 21a0bef Thanks @dario-piotrowicz! - Add strict mode for the wrangler deploy command

    Add a new flag: --strict that makes the wrangler deploy command be more strict and not deploy workers when the deployment could be potentially problematic. This "strict mode" currently only affects non-interactive sessions where conflicts with the remote settings for the worker (for example when the worker has been re-deployed via the dashboard) will cause the deployment to fail instead of automatically overriding the remote settings.

  • #10710 7f2386e Thanks @penalosa! - Add prompt to resource creation flow allowing for newly created resources to be remote.

Patch Changes

  • #10822 4c06766 Thanks @edmundhung! - fix: skip banner when using --json flag in wrangler pages deployment commands

  • #10838 d3aee31 Thanks @edmundhung! - fix: skip banner when using --json flag in wrangler queues subscription commands

  • #10829 59e8ef0 Thanks @edmundhung! - fix: skip banner when using --json flag in wrangler pipelines commands

  • #10764 79a6b7d Thanks @emily-shen! - containers: default max_instances to 20 instead of 1.

  • #10844 7a4d0da Thanks @mikenomitch! - Adds new Container instance types, and rename dev to lite and standard to standard-1. The new instance_types are now:

    Instance Type vCPU Memory Disk
    lite (previously dev) 1/16 256 MiB 2 GB
    basic 1/4 1 GiB 4 GB
    standard-1 (previously standard) 1/2 4 GiB 8 GB
    standard-2 1 6 GiB 12 GB
    standard-3 2 8 GiB 16 GB
    standard-4 4 12 GiB 20 GB
  • #10634 62656bd Thanks @emily-shen! - fix: error if the container image uri has an account id that doesn't match the current account

  • #10761 886e577 Thanks @petebacondarwin! - switch zone route warning to an info message

  • #10734 8d7f32e Thanks @penalosa! - Improve formatting of logged errors in some cases

  • #10832 f9d37db Thanks @petebacondarwin! - retry subdomain requests to be more resilient to flakes

  • #10770 835d6f7 Thanks @danielrs! - Enabling or disabling workers_dev is often an indication that the user is also trying to enable or disable preview_urls. Warn the user when these enter mixed state.

  • #10764 79a6b7d Thanks @emily-shen! - fix: respect the log level set by wrangler when logging using @cloudflare/cli

  • Updated dependencies [c8d5282, bffd2a9]:

4.40.3

Patch Changes

  • #10602 ff82d80 Thanks @tukiminya! - fix: update Secrets Store command status from alpha to open-beta

  • #10623 7a6381c Thanks @IRCody! - Handle more cases for correctly resolving the full uri for an image when using containers push.

  • #10779 325d22e Thanks @hoodmane! - Add fallthrough: true for python_modules data rule

  • #10112 8d07576 Thanks @devin-ai-integration! - fix: allow Workflow bindings when calling getPlatformProxy()

    Workflow bindings are not supported in practice when using getPlatformProxy(). But their existence in a Wrangler config file should not prevent other bindings from working. Previously, calling getPlatformProxy() would crash if there were any Workflow bindings defined. Now, instead, you get a warning telling you that these bindings are not available.

  • #10769 0a554f9 Thanks @penalosa! - Mark more errors as UserError to disable Sentry reporting

  • #10679 6244a9e Thanks @KianNH! - Fix rendering for nested objects in containers list and containers info [ID]

  • #10785 d09cab3 Thanks @pombosilva! - Workflows names and instance IDs are now properly validated with production limits.

  • Updated dependencies [6ff41a6, 0c208e1, 2432022, d0801b1, 0a554f9]:

4.40.2

Patch Changes

4.40.1

Patch Changes

4.40.0

Minor Changes

  • #10743 a7ac751 Thanks @jonesphillip! - Changes --fileSizeMB to --file-size for wrangler r2 bucket catalog compaction command. Small fixes for pipelines commands.

Patch Changes

  • #10706 81fd733 Thanks @1000hz! - Fixed an issue that caused some Workers to have an incorrect service tag applied when using a redirected configuration file (as used by the Cloudflare Vite plugin). This resulted in these Workers not being correctly grouped with their sibling environments in the Cloudflare dashboard.

  • Updated dependencies [06e9a48]:

4.39.0

Minor Changes

  • #10647 555a6da Thanks @efalcao! - VPC service binding support

  • #10612 97a72cc Thanks @jonesphillip! - Added new pipelines commands (pipelines, streams, sinks, setup), moved old pipelines commands behind --legacy

  • #10652 acd48ed Thanks @edmundhung! - Rename Hyperdrive local connection string environment variable from WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME> to CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME>. The old variable name is still supported but will now show a deprecation warning.

  • #10721 55a10a3 Thanks @penalosa! - Stabilise Worker Loader bindings

Patch Changes

4.38.0

Minor Changes

  • #10654 a4e2439 Thanks @laplab! - Switch to WRANGLER_R2_SQL_AUTH_TOKEN env variable for R2 SQL secret. Update the response format for R2 SQL

  • #10676 f76da43 Thanks @penalosa! - Support ctx.exports in wrangler types

  • #10651 6caf938 Thanks @edevil! - Added new attribute "allowed_sender_addresses" to send email binding.

Patch Changes

4.37.1

Patch Changes

4.37.0

Minor Changes

  • #10546 d53a0bc Thanks @1000hz! - On deploy or version upload, Workers with multiple environments are tagged with metadata that groups them together in the Cloudflare Dashboard.

  • #10596 735785e Thanks @penalosa! - Add Miniflare & Wrangler support for unbound Durable Objects

  • #10622 15c34e2 Thanks @nagraham! - Modify R2 Data Catalog compaction commands to enable/disable for Catalog (remove table/namespace args), and require Cloudflare API token on enable.

Patch Changes

4.36.0

Minor Changes

  • #10604 135e066 Thanks @penalosa! - Enable Remote Bindings without the need for the --x-remote-bindings flag

  • #10558 30f558e Thanks @laplab! - Add commands to send queries and manage R2 SQL product.

  • #10574 d8860ac Thanks @efalcao! - Add support for VPC services CRUD via wrangler vpc service

  • #10119 336a75d Thanks @dxh9845! - Add support for dynamically loading 'external' Miniflare plugins for unsafe Worker bindings (developed outside of the workers-sdk repo)

Patch Changes

4.35.0

Minor Changes

  • #10491 5cb806f Thanks @zebp! - Add traces, OTEL destinations, and configurable persistence to observability settings

    Adds a new traces field to the observability settings in your Worker configuration that configures the behavior of automatic tracing. Both traces and logs support providing a list of OpenTelemetry compliant destinations where your logs/traces will be exported to as well as an implicitly-enabled persist option that controls whether or not logs/traces are persisted to the Cloudflare observability platform and viewable in the Cloudflare dashboard.

Patch Changes

  • #10571 4e49d3e Thanks @dario-piotrowicz! - add missing type for send_email's experimental_remote field

  • #10534 dceb550 Thanks @dario-piotrowicz! - update unstable_convertConfigBindingsToStartWorkerBindings to prioritize preview config values

    Ensure that if some bindings include preview values (e.g. preview_database_id for D1 bindings) those get used instead of the standard ones (since these are the ones that start worker should be using)

  • #10552 3b78839 Thanks @vicb! - Bump unenv to 2.0.0-rc.21

  • Updated dependencies [dac302c, 3b78839]:

4.34.0

Minor Changes

  • #10478 cc47b51 Thanks @danielrs! - Beta feature preview_urls is now disabled by default.

    This change makes preview_urls disabled by default when it's not provided, making the feature opt-in instead of opt-out.

Patch Changes

4.33.2

Patch Changes

4.33.1

Patch Changes

4.33.0

Minor Changes

  • #10414 e81c2cf Thanks @penalosa! - Support automatically updating the user's config file with newly created resources

Patch Changes

4.32.0

Minor Changes

  • #10354 da40571 Thanks @edmundhung! - Enable cross-process communication for wrangler dev with multiple config files

    Workers running in separate wrangler dev sessions can now communicate with each other regardless of whether you are running with single or multiple config files.

    Check out the Developing with multiple Workers guide to learn more about the different approaches and when to use each one.

  • #10012 4728c68 Thanks @penalosa! - Support unsafe dynamic worker loading bindings

Patch Changes

  • #10245 d304055 Thanks @edmundhung! - Migrate wrangler dev to use Miniflare dev registry implementation

    Updated wrangler dev to use a shared dev registry implementation that now powers both the Cloudflare Vite plugin and Wrangler. This internal refactoring has no user-facing changes but consolidates registry logic for better consistency across tools.

  • #10407 f534c0d Thanks @emily-shen! - default containers.rollout_active_grace_period to 0

  • #10425 0a96e69 Thanks @dario-piotrowicz! - Fix debugging logs not including headers for CF API requests and responses

    Fix the fact that wrangler, when run with the WRANGLER_LOG=DEBUG and WRANGLER_LOG_SANITIZE=false environment variables, displays {} instead of the actual headers for requests and responses for CF API fetches

  • #10337 f9f7519 Thanks @emily-shen! - containers: rollout_step_percentage now also accepts an array of numbers. Previously it accepted a single number, and each rollout step would target the same percentage of instances. Now users can customise percentages for each step.

    rollout_step_percentage also now defaults to [10,100] (previously 25), which should make rollouts progress slightly faster.

    You can also use wrangler deploy --containers-rollout=immediate to override rollout settings in Wrangler configuration and update all instances in one step. Note this doesn't override rollout_active_grace_period if configured.

  • Updated dependencies [4728c68]:

4.31.0

Minor Changes

  • #10314 9b09751 Thanks @dario-piotrowicz! - Show possible local vs. dashboard diff information on deploys

    When re-deploying a Worker using wrangler deploy, if the configuration has been modified in the Cloudflare dashboard, the local configuration will overwrite the remote one. This can lead to unexpected results for users. To address this, currently wrangler deploy warns users about potential configuration overrides (without presenting them) and prompts them to confirm whether they want to proceed.

    The changes here improve the above flow in the following way:

    • If the local changes only add new configurations (without modifying or removing existing ones), the deployment proceeds automatically without warnings or prompts, as these changes are non-destructive and safe.
    • If the local changes modify or remove existing configurations, wrangler deploy now displays a git-like diff showing the differences between the dashboard and local configurations. This allows users to review and understand the impact of their changes before confirming the deployment.
  • #10334 cadf19a Thanks @jonesphillip! - Added queues subscription command to Wrangler including create, update, delete, get, list

Patch Changes

  • #10374 20520fa Thanks @edmundhung! - Simplify debug package resolution with nodejs_compat

    A patched version of debug was previously introduced that resolved the package to a custom implementation. However, this caused issues due to CJS/ESM interop problems. We now resolve the debug package to use the Node.js implementation instead.

  • #10249 875197a Thanks @penalosa! - Support JSRPC for remote bindings. This unlocks:

    • JSRPC over Service Bindings
    • JSRPC over Dispatch Namespace Bindings
    • Email
    • Pipelines
  • Updated dependencies [565c3a3, ddadb93, 20520fa, 875197a]:

4.30.0

Minor Changes

Patch Changes

  • #10217 979984b Thanks @veggiedefender! - Increase the maxBuffer size for capnp uploads

  • #10356 80e964c Thanks @WillTaylorDev! - fix: Update regex for valid branch name to remove 61 char length requirement, allowing for longer branch names to be specified for preview aliases.

  • #10289 a5a1426 Thanks @emily-shen! - Cleanup container images created during local dev if no changes have been made.

    We now untag old images that were created by Wrangler/Vite if we find that the image content and configuration is unchanged, so that we don't keep accumulating image tags.

  • #10315 0c04da9 Thanks @emily-shen! - Add rollout_active_grace_period option to containers configuration.

    This allows users to configure how long an active container should keep running for during a rollout, before the upgrade is applied.

  • #10321 b524a6f Thanks @emily-shen! - print prettier errors during container deployment

  • #10253 eb32a3a Thanks @emily-shen! - fix redeploying container apps when previous deploy failed or container (but not image) was deleted.

    Previously this failed with No changes detected but no previous image found as we assumed there would be a previous deployment when an image exists in the registry.

  • #9990 4288a61 Thanks @penalosa! - Fix startup profiling when sourcemaps are enabled

  • Updated dependencies [d54d8b7, ae0c806]:

4.29.1

Patch Changes

4.29.0

Minor Changes

  • #10283 80960b9 Thanks @WillTaylorDev! - Support long branch names in generation of branch aliases in WCI.

  • #10312 bd8223d Thanks @devin-ai-integration! - Added --domain flag to wrangler deploy command for deploying to custom domains. Use --domain example.com to deploy directly to a custom domain without manually configuring routes.

  • #8318 8cf47f9 Thanks @gnekich! - Introduce json output flag for wrangler pages deployment list

Patch Changes

  • #10232 e7cae16 Thanks @emily-shen! - fix: validate wrangler containers delete ID to ensure a valid ID has been provided. Previously if you provided the container name (or any non-ID shaped string) you would get an auth error instead of a 404.

  • #10139 3b6ab8a Thanks @dom96! - Removes mention of cf-requirements when Python Workers are enabled

  • #10259 c58a05c Thanks @dario-piotrowicz! - Ensure that maybeStartOrUpdateRemoteProxySession considers the potential account_id from the user's wrangler config

    Currently if the user has an account_id in their wrangler config file, such id won't be taken into consideration for the remote proxy session, the changes here make sure that it is (note that the auth option of maybeStartOrUpdateRemoteProxySession, if provided, takes precedence over this id value).

    The changes here also fix the same issue for wrangler dev and getPlatformProxy (since they use maybeStartOrUpdateRemoteProxySession under the hook).

  • #10288 42aafa3 Thanks @tgarg-cf! - Do not attempt to update queue producer settings when deploying a Worker with a queue binding

    Previously, each deployed Worker would update a subset of the queue producer's settings for each queue binding, which could result in broken queue producers or at least conflicts where different Workers tried to set different producer settings on a shared queue.

  • #10242 70bd966 Thanks @devin-ai-integration! - Add experimental API to expose Wrangler command tree structure for documentation generation

  • #10258 d391076 Thanks @nikitassharma! - Add the option to allow all tiers when creating a container

  • #10248 422ae22 Thanks @emily-shen! - fix: re-push container images on deploy even if the only change was to the Dockerfile

  • #10179 5d5ecd5 Thanks @pombosilva! - Prevent defining multiple workflows with the same "name" property in the same wrangler file

  • #10232 e7cae16 Thanks @emily-shen! - include containers API calls in output of WRANGLER_LOG=debug

  • #10243 d481901 Thanks @devin-ai-integration! - Remove async_hooks polyfill - now uses native workerd implementation

    The async_hooks module is now provided natively by workerd, making the polyfill unnecessary. This improves performance and ensures better compatibility with Node.js async_hooks APIs.

  • #10060 9aad334 Thanks @edmundhung! - refactor: switch getPlatformProxy() to use Miniflare's dev registry implementation

    Updated getPlatformProxy() to use Miniflare's dev registry instead of Wrangler's implementation. Previously, you had to start a wrangler or vite dev session before accessing the proxy bindings to connect to those workers. Now the order doesn't matter.

  • #10219 28494f4 Thanks @dario-piotrowicz! - fix NonRetryableError thrown with an empty error message not stopping workflow retries locally

  • Updated dependencies [1479fd0, 05c5b28, e3d9703, d481901]:

4.28.1

Patch Changes

  • #10130 773cca3 Thanks @dario-piotrowicz! - update maybeStartOrUpdateRemoteProxySession config argument (to allow callers to specify an environment)

    Before this change maybeStartOrUpdateRemoteProxySession could be called with either the path to a wrangler config file or the configuration of a worker. The former override however did not allow the caller to specify an environment, so the maybeStartOrUpdateRemoteProxySession API has been updated so that in the wrangler config case an object (with the path and a potential environment) needs to be passed instead.

    For example, before callers could invoke the function in the following way

    await maybeStartOrUpdateRemoteProxySession(configPath);
    

    note that there is no way to tell the function what environment to use when parsing the wrangle configuration.

    Now callers will instead call the function in the following way:

    await maybeStartOrUpdateRemoteProxySession({
      path: configPath,
      environment: targetEnvironment,
    });
    

    note that now a target environment can be specified.

  • #10130 773cca3 Thanks @dario-piotrowicz! - fix getPlatformProxy not taking into account the potentially specified environment for remote bindings

  • #10122 2e8eb24 Thanks @dario-piotrowicz! - fix startWorker not respecting auth options for remote bindings

    fix startWorker currently not taking into account the auth field that can be provided as part of the dev options when used in conjunction with remote bindings

    example:

    Given the following

    import { unstable_startWorker } from "wrangler";
    
    const worker = await unstable_startWorker({
      entrypoint: "./worker.js",
      bindings: {
        AI: {
          type: "ai",
          experimental_remote: true,
        },
      },
      dev: {
        experimentalRemoteBindings: true,
        auth: {
          accountId: "<ACCOUNT_ID>",
          apiToken: {
            apiToken: "<API_TOKEN>",
          },
        },
      },
    });
    
    await worker.ready;
    

    wrangler will now use the provided <ACCOUNT_ID> and <API_TOKEN> to integrate with the remote AI binding instead of requiring the user to authenticate.

  • #10209 93c4c26 Thanks @devin-ai-integration! - fix: strip ANSI escape codes from log files to improve readability and parsing

  • #9774 48853a6 Thanks @nikitassharma! - Validate container configuration against account limits in wrangler to give early feedback to the user

  • #10122 2e8eb24 Thanks @dario-piotrowicz! - fix incorrect TypeScript type for AI binding in the startWorker API

4.28.0

Minor Changes

Patch Changes

  • #10004 b4d1373 Thanks @dario-piotrowicz! - fix wrangler dev logs being logged on the incorrect level in some cases

    currently the way wrangler dev prints logs is faulty, for example the following code

    console.error("this is an error");
    console.warn("this is a warning");
    console.debug("this is a debug");
    

    inside a worker would cause the following logs:

    ✘ [ERROR] this is an error
    
    ✘ [ERROR] this is a warning
    
    this is a debug
    

    (note that the warning is printed as an error and the debug log is printed even if by default it should not)

    the changes here make sure that the logs are instead logged to their correct level, so for the code about the following will be logged instead:

    ✘ [ERROR] this is an error
    
    ▲ [WARNING] this is a warning
    

    (running wrangler dev with the --log-level=debug flag will also cause the debug log to be included as well)

  • #10099 360004d Thanks @emily-shen! - fix: move local dev container cleanup to process exit hook. This should ensure containers are cleaned up even when Wrangler is shut down programatically.

  • #10186 dae1377 Thanks @matthewdavidrodgers! - Deleting when Pages project binds to worker requires confirmation

  • #10169 1655bec Thanks @devin-ai-integration! - fix: report startup errors before workerd profiling

  • #10136 354a001 Thanks @nikitassharma! - Update wrangler containers images list to make fewer API calls to improve command runtime

  • #10157 5c3b83f Thanks @devin-ai-integration! - Enforce 64-character limit for Workflow binding names locally to match production validation

  • #10154 502a8e0 Thanks @devin-ai-integration! - Fix UTF BOM handling in config files - remove UTF-8 BOM and error on other BOMs

  • #10176 07c8611 Thanks @devin-ai-integration! - Add macOS version validation to prevent EPIPE errors on unsupported macOS versions (below 13.5). Miniflare and C3 fail hard while Wrangler shows warnings but continues execution.

  • Updated dependencies [6b9cd5b, 631f26d, d6ecd05, b4d1373, 8ba7736, 07c8611, 7e204a9, 3f83ac1]:

4.27.0

Minor Changes

  • #9914 a24c9d8 Thanks @petebacondarwin! - Add support for loading local dev vars from .env files

    If there are no .dev.vars or .dev.vars.<environment> files, when running Wrangler or the Vite plugin in local development mode, they will now try to load additional local dev vars from .env, .env.local, .env.<environment> and .env.<environment>.local files.

    These loaded vars are only for local development and have no effect in production to the vars in a deployed Worker. Wrangler and Vite will continue to load .env files in order to configure themselves as a tool.

    Further details:

    • In vite build the local vars will be computed and stored in a .dev.vars file next to the compiled Worker code, so that vite preview can use them.
    • The wrangler types command will similarly read the .env files (if no .dev.vars files) in order to generate the Env interface.
    • If the CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENV environment variable is "false" then local dev variables will not be loaded from .env files.
    • If the CLOUDFLARE_INCLUDE_PROCESS_ENV environment variable is "true" then all the environment variables found on process.env will be included as local dev vars.
    • Wrangler (but not Vite plugin) also now supports the --env-file=<path/to/dotenv/file> global CLI option. This affects both loading .env to configure Wrangler the tool as well as loading local dev vars.

Patch Changes

  • #10051 0f7820e Thanks @nikitassharma! - Add support for custom instance limits for containers. For example, instead of having to use the preconfigured dev/standard/basic instance types, you can now set:

    instance_type: {
      vcpu: 1,
      memory_mib: 1024,
      disk_mb: 4000
    }
    

    This feature is currently only available to customers on an enterprise plan.

  • #10149 e9bb8d3 Thanks @vicb! - fix require("debug") in nodejs_compat mode

  • Updated dependencies [9b61f44]:

4.26.1

Patch Changes

  • #10061 f8a80a8 Thanks @emily-shen! - feat(containers): try to automatically get the socket path that the container engine is listening on.

    Currently, if your container engine isn't set up to listen on unix:///var/run/docker.sock (or isn't symlinked to that), then you have to manually set this via the dev.containerEngine field in your Wrangler config, or via the env vars WRANGLER_DOCKER_HOST. This change means that we will try and get the socket of the current context automatically. This should reduce the occurrence of opaque internal errors thrown by the runtime when the daemon is not listening on unix:///var/run/docker.sock.

    In addition to WRANGLER_DOCKER_HOST, DOCKER_HOST can now also be used to set the container engine socket address.

  • #10048 dbdbb8c Thanks @vicb! - pass the compatibility date and flags to the unenv preset

  • #10096 687655f Thanks @vicb! - bump unenv to 2.0.0-rc.19

  • #9897 755a249 Thanks @edmundhung! - fix: wrangler types should infer the types of the default worker entrypoint

  • Updated dependencies [82a5b2e, f8f7352, 2df1d06, dbdbb8c, 5991a9c, 687655f]:

4.26.0

Minor Changes

  • #10016 c5b291d Thanks @emily-shen! - Interactively handle wrangler deploys that are probably assets-only, where there is no config file and flags are incorrect or missing.

    For example:

    npx wrangler deploy ./public will now ask if you meant to deploy a folder of assets only, ask for a name, set the compat date and then ask whether to write your choices out to wrangler.json for subsequent deployments.

    npx wrangler deploy --assets=./public will now ask for a name, set the compat date and then ask whether to write your choices out to wrangler.json for subsequent deployments.

    In non-interactive contexts, Wrangler will error as it currently does.

  • #9971 19794bf Thanks @edmundhung! - Improved script source display on the pretty error screen

Patch Changes

  • #9800 3d4f946 Thanks @helloimalastair! - remove banner from r2 getobject in pipe mode

  • #9910 7245101 Thanks @dario-piotrowicz! - make sure that the ready-on message is printed after the appropriate runtime controller is ready

    fix the fact that when starting a local (or remote) dev session the log saying Ready on http://localhost:xxxx could be displayed before the runtime is actually ready to handle requests (this is quite noticeable when locally running dev sessions with containers, where the ready message currently gets displayed before the container images building/pulling process)

  • #10031 823cba8 Thanks @vicb! - wrangler and vite-plugin now depend upon the latest version of unenv-preset

  • #10032 154acf7 Thanks @dario-piotrowicz! - add support for containers in wrangler multiworker dev

    currently when running wrangler dev with different workers (meaning that the -c|--config flag is used multiple times) containers are not being included, meaning that trying to interact with them at runtime would not work and cause errors instead. The changes here address the above making wrangler correctly detect and wire up the containers.

  • #9988 7fb0bfd Thanks @penalosa! - Correctly label mtls remote bindings warning

  • Updated dependencies [823cba8, 19794bf, 059a39e]:

4.25.1

Patch Changes

  • #10000 c02b067 Thanks @emily-shen! - Include more (sanitised) user errors in telemetry.

    We manually vet and sanitised error messages before including them in our telemetry collection - this PR just includes a couple more.

  • #9996 b0217f9 Thanks @nikitassharma! - Disallow users from pushing images with unsupported platforms to the container image registry

  • #10009 e87198a Thanks @gpanders! - Fix containers diff output when using JSONC config files

  • #9976 ad02ad3 Thanks @dario-piotrowicz! - add warning for when users run wrangler dev --remote with (enabled) containers

  • #9819 0c4008c Thanks @CarmenPopoviciu! - feat(vite-plugin): Add containers support in vite dev

    Adds support for Cloudflare Containers in vite dev. Please note that at the time of this PR a container image can only specify the path to a Dockerfile. Support for registry links will be added in a later version, as will containers support in vite preview.

  • Updated dependencies [189fe23, 7e5585d]:

4.25.0

Minor Changes

Patch Changes

4.24.4

Patch Changes

4.24.3

Patch Changes

  • #9923 c01c4ee Thanks @gpanders! - Fix image name resolution when modifying a container application

  • #9833 3743896 Thanks @dario-piotrowicz! - fix: ensure that container builds don't disrupt dev hotkey handling

    currently container builds run during local development (via wrangler dev or startWorker) prevent the standard hotkeys not to be recognized (most noticeably ctrl+c, preventing developers from existing the process), the changes here ensure that hotkeys are instead correctly handled as expected

  • Updated dependencies []:

4.24.2

Patch Changes

4.24.1

Patch Changes

  • #9765 05adc61 Thanks @hasip-timurtas! - Build container images without the user's account ID. This allows containers to be built and verified in dry run mode (where we do not necessarily have the user's account info).

    When we push the image to the managed registry, we first re-tag the image to include the user's account ID so that the image has the full resolved image name.

  • Updated dependencies [bb09e50, 25dbe54, 3bdec6b]:

4.24.0

Minor Changes

  • #9796 ba69586 Thanks @simonabadoiu! - Browser Rendering local mode

  • #9825 49c85c5 Thanks @ReppCodes! - Add support for origin_connection_limit to Wrangler

    Configure connection limits to Hyperdrive via command line options:

    • --origin-connection-limit: The (soft) maximum number of connections that Hyperdrive may establish to the origin database.
  • #9064 a1181bf Thanks @sdnts! - Added an event-subscriptions subcommand

Patch Changes

  • #9729 1b3a2b7 Thanks @404Wolf! - Set docker build context to the Dockerfile directory when image_build_context is not explicitly provided

  • #9845 dbfa4ef Thanks @jonboulle! - remove extraneous double spaces from Wrangler help output

  • #9811 fc29c31 Thanks @gpanders! - Fix unauthorized errors on "containers images delete".

  • #9813 45497ab Thanks @gpanders! - Support container image names without account ID

  • #9821 a447d67 Thanks @WillTaylorDev! - Preview Aliases: Force alias generation to meet stricter naming requirements.

    For cases where CI is requesting Wrangler to generate the alias based on the branch name, we want a stricter check around the generated alias name in order to avoid version upload failures. If a valid alias name was not able to be generated, we warn and do not provide an alias (avoiding a version upload failure).

  • #9840 7c55f9e Thanks @dario-piotrowicz! - fix: make sure that the experimental remoteBindings flag is properly handled in getPlatformProxy

    There are two issues related to how the experimental remoteBindings flag is handled in getPlatformProxy that are being fixed by this change:

    • the experimental_remote configuration flag set on service bindings is incorrectly always taken into account, even if remoteBindings is set to false
    • the experimental_remote configuration flag of all the other bindings is never taken into account (effectively preventing the bindings to be used in remote mode) since the remoteBindings flag is not being properly propagated
  • #9801 0bb619a Thanks @IRCody! - Containers: Fix issue where setting an image URI instead of dockerfile would incorrectly not update the image

  • #9872 a727db3 Thanks @emily-shen! - fix: resolve Dockerfile path relative to the Wrangler config path

    This fixes a bug where Wrangler would not be able to find a Dockerfile if a Wrangler config path had been specified with the --config flag.

  • #9815 1358034 Thanks @gpanders! - Remove --json flag from containers and cloudchamber commands (except for "images list")

  • #9734 1a58bc3 Thanks @penalosa! - Make Wrangler warn more loudly if you're missing auth scopes

  • #9748 7e3aa1b Thanks @alsuren! - Internal-only WRANGLER_D1_EXTRA_LOCATION_CHOICES environment variable for enabling D1's testing location hints

  • Updated dependencies [ba69586, 1a75f85, 395f36d, 6f344bf]:

4.23.0

Minor Changes

  • #9535 56dc5c4 Thanks @penalosa! - In 2023 we announced breakpoint debugging support for Workers, which meant that you could easily debug your Worker code in Wrangler's built-in devtools (accessible via the [d] hotkey) as well as multiple other devtools clients, including VSCode. For most developers, breakpoint debugging via VSCode is the most natural flow, but until now it's required manually configuring a launch.json file, running wrangler dev, and connecting via VSCode's built-in debugger.

    Now, using VSCode's built-in JavaScript Debug Terminals, there are just two steps: open a JS debug terminal and run wrangler dev (or vite dev). VSCode will automatically connect to your running Worker (even if you're running multiple Workers at once!) and start a debugging session.

  • #9810 8acaf43 Thanks @WillTaylorDev! - WC-3626 Pull branch name from WORKERS_CI_BRANCH if exists.

Patch Changes

4.22.0

Minor Changes

  • #7871 f2a8d4a Thanks @dario-piotrowicz! - add support for assets bindings to getPlatformProxy

    this change makes sure that that getPlatformProxy, when the input configuration file contains an assets field, correctly returns the appropriate asset binding proxy

    example:

    // wrangler.jsonc
    {
      "name": "my-worker",
      "assets": {
        "directory": "./public/",
        "binding": "ASSETS"
      }
    }
    
    import { getPlatformProxy } from "wrangler";
    
    const { env, dispose } = await getPlatformProxy();
    
    const text = await (await env.ASSETS.fetch("http://0.0.0.0/file.txt")).text();
    console.log(text); // logs the content of file.txt
    
    await dispose();
    

Patch Changes

4.21.2

Patch Changes

  • #9731 75b75f3 Thanks @gabivlj! - containers: Check for container scopes before running a container command to give a better error

  • #9641 fdbc9f6 Thanks @IRCody! - Update container builds to use a more robust method for detecting if the currently built image already exists.

  • #9736 55c83a7 Thanks @gabivlj! - containers: Do not check scopes if not defined

  • #9667 406fba5 Thanks @IRCody! - Fail earlier in the deploy process when deploying a container worker if docker is not detected.

4.21.1

Patch Changes

4.21.0

Minor Changes

  • #9692 273952f Thanks @dom96! - Condenses Python vendored modules in output table

  • #9654 2a5988c Thanks @dom96! - Python Workers now automatically bundle .so files from vendored packages

Patch Changes

  • #9695 0e64c35 Thanks @emily-shen! - Move hotkey registration later in dev start up

    This should have no functional change, but allows us to conditionally render hotkeys based on config.

  • #9098 ef20754 Thanks @jseba! - Migrate Workers Containers commands to Containers API Endpoints

    The Workers Containers API was built on top of Cloudchamber, but has now been moved to its own API with a reduced scoping and new token.

  • #9712 2a4c467 Thanks @emily-shen! - Make wrangler container commands print open-beta status

4.20.5

Patch Changes

  • #9688 086e29d Thanks @dario-piotrowicz! - add remote bindings support to getPlatformProxy

    Example:

    // wrangler.jsonc
    {
      "name": "get-platform-proxy-test",
      "services": [
        {
          "binding": "MY_WORKER",
          "service": "my-worker",
          "experimental_remote": true
        }
      ]
    }
    
    // index.mjs
    import { getPlatformProxy } from "wrangler";
    
    const { env } = await getPlatformProxy({
      experimental: {
        remoteBindings: true,
      },
    });
    
    // env.MY_WORKER.fetch() fetches from the remote my-worker service
    
  • #9558 d5edf52 Thanks @ichernetsky-cf! - wrangler containers apply uses observability configuration.

  • #9678 24b2c66 Thanks @dario-piotrowicz! - remove warnings during config validations on experimental_remote fields

    wrangler commands, run without the --x-remote-bindings flag, parsing config files containing experimental_remote fields currently show warnings stating that the field is not recognized. This is usually more cumbersome than helpful so here we're loosening up this validation and making wrangler always recognize the field even when no --x-remote-bindings flag is provided

  • #9633 3f478af Thanks @nikitassharma! - Add support for setting an instance type for containers in wrangler. This allows users to configure memory, disk, and vCPU by setting instance type when interacting with containers.

  • #9596 5162c51 Thanks @CarmenPopoviciu! - add ability to pull images for containers local dev

  • Updated dependencies [bfb791e, 5162c51]:

4.20.4

Patch Changes

4.20.3

Patch Changes

4.20.2

Patch Changes

  • #9565 b1c9139 Thanks @IRCody! - Ensure that a container applications image configuration is not updated if there were not changes to the image.

  • #9628 92f12f4 Thanks @gpanders! - Remove "Cloudchamber" from user facing error messages

  • #9576 2671e77 Thanks @vicb! - Add core local dev functionality for containers. Adds a new WRANGLER_DOCKER_HOST env var to customise what socket to connect to.

  • Updated dependencies [828b7df, 2671e77]:

4.20.1

Patch Changes

  • #9536 3b61c41 Thanks @dario-piotrowicz! - expose Unstable_Binding type

  • #9564 1d3293f Thanks @skepticfx! - Switch container registry to registry.cloudflare.com from registry.cloudchamber.cfdata.org. Also adds the env var CLOUDFLARE_CONTAINER_REGISTRY to override this

  • #9520 04f9164 Thanks @vicb! - fix the default value for keep_names (true)

  • #9506 36113c2 Thanks @penalosa! - Strip the CF-Connecting-IP header from outgoing fetches

  • #9592 49f5ac7 Thanks @petebacondarwin! - Point to the right location for docs on telemetry

  • #9593 cf33417 Thanks @vicb! - drop unused WRANGLER_UNENV_RESOLVE_PATHS env var

  • #9566 521eeb9 Thanks @vicb! - Bump @cloudflare/unenv-preset to 2.3.3

  • #9344 02e2c1e Thanks @dario-piotrowicz! - add warning about env not specified to potentially risky wrangler commands

    add a warning suggesting users to specify their target environment (via -e or --env) when their wrangler config file contains some environments and they are calling one of the following commands:

    • wrangler deploy
    • wrangler versions upload
    • wrangler versions deploy
    • wrangler versions secret bulk
    • wrangler versions secret put
    • wrangler versions secret delete
    • wrangler secret bulk
    • wrangler secret put
    • wrangler secret delete
    • wrangler triggers deploy

    this is a measure we're putting in place to try to prevent developers from accidentally applying changes to an incorrect (potentially even production) environment

  • #9344 02e2c1e Thanks @dario-piotrowicz! - allow passing an empty string to the -e|--env flag to target the top-level environment

  • #9536 3b61c41 Thanks @dario-piotrowicz! - performance improvement: restart a mixed mode session only if the worker's remote bindings have changed

  • #9550 c117904 Thanks @dario-piotrowicz! - allow startWorker to accept false as an inspector option (to disable the inspector server)

  • #9473 fae8c02 Thanks @dario-piotrowicz! - expose new experimental_maybeStartOrUpdateMixedModeSession utility

  • Updated dependencies [bd528d5, 2177fb4, 36113c2, e16fcc7]:

4.20.0

Minor Changes

  • #9509 0b2ba45 Thanks @emily-shen! - feat: add static routing options via 'run_worker_first' to Wrangler

    Implements the proposal noted here https://github.com/cloudflare/workers-sdk/discussions/9143.

    This is now usable in wrangler dev and in production - just specify the routes that should hit the worker first with run_worker_first in your Wrangler config. You can also omit certain paths with ! negative rules.

Patch Changes

  • #9507 1914b87 Thanks @dario-piotrowicz! - slightly improve wrangler dev bindings loggings

    improve the bindings loggings by:

    • removing the unnecessary (and potentially incorrect) [connected] suffix for remote bindings
    • making sure that the modes presented in the bindings logs are correctly aligned
  • #9475 931f467 Thanks @edmundhung! - add hello world binding that serves as as an explanatory example.

  • #9443 95eb47d Thanks @dario-piotrowicz! - add workerName option to startMixedModeSession API

  • #9541 80b8bd9 Thanks @dario-piotrowicz! - make workers created with startWorker await the ready promise on dispose

  • #9443 95eb47d Thanks @dario-piotrowicz! - add mixed-mode support for mtls bindings

  • #9515 9e4cd16 Thanks @dario-piotrowicz! - make sure that remote binding errors are surfaced when using mixed (hybrid) mode

  • #9516 92305af Thanks @IRCody! - Reorder deploy output when deploying a container worker so the worker url is printed last and the worker triggers aren't deployed until the container has been built and deployed successfully.

  • Updated dependencies [931f467, 95eb47d, 0b2ba45]:

4.19.2

Patch Changes

  • #9461 66edd2f Thanks @skepticfx! - Enforce disk limits on container builds

  • #9481 d1a1787 Thanks @WillTaylorDev! - Force autogenerated aliases to be fully lowercased.

  • #9480 1f84092 Thanks @dario-piotrowicz! - add experimentalMixedMode dev option to unstable_startWorker

    add an new experimentalMixedMode dev option to unstable_startWorker that allows developers to programmatically start a new mixed mode session using startWorker.

    Example usage:

    // index.mjs
    import { unstable_startWorker } from "wrangler";
    
    await unstable_startWorker({
      dev: {
        experimentalMixedMode: true,
      },
    });
    
    // wrangler.jsonc
    {
      "$schema": "node_modules/wrangler/config-schema.json",
      "name": "programmatic-start-worker-example",
      "main": "src/index.ts",
      "compatibility_date": "2025-06-01",
      "services": [
        { "binding": "REMOTE_WORKER", "service": "remote-worker", "remote": true }
      ]
    }
    
  • Updated dependencies [4ab5a40, 485cd08, e3b3ef5, 3261957]:

4.19.1

Patch Changes

4.19.0

Minor Changes

Patch Changes

4.18.0

Minor Changes

Patch Changes

  • #9308 d3a6eb3 Thanks @dario-piotrowicz! - expose new utilities and types to aid consumers of the programmatic mixed-mode API

    Specifically the exports have been added:

    • Experimental_MixedModeSession: type representing a mixed-mode session
    • Experimental_ConfigBindingsOptions: type representing config-bindings
    • experimental_pickRemoteBindings: utility for picking only the remote bindings from a record of start-worker bindings.
    • unstable_convertConfigBindingsToStartWorkerBindings: utility for converting config-bindings into start-worker bindings (that can be passed to startMixedModeSession)
  • #9347 b8f058c Thanks @penalosa! - Improve binding display on narrower terminals

  • Updated dependencies [d9d937a, e39a45f, fdae3f7]:

4.17.0

Minor Changes

  • #9321 6c03bde Thanks @petebacondarwin! - Add support for FedRAMP High compliance region

    Now it is possible to target Wrangler at the FedRAMP High compliance region. There are two ways to signal to Wrangler to run in this mode:

    • set "compliance_region": "fedramp_high" in a Wrangler configuration
    • set CLOUDFLARE_COMPLIANCE_REGION=fedramp_high environment variable when running Wrangler

    If both are provided and the values do not match then Wrangler will exit with an error.

    When in this mode OAuth authentication is not supported. It is necessary to authenticate using a Cloudflare API Token acquired from the Cloudflare FedRAMP High dashboard.

    Most bindings and commands are supported in this mode.

    • Unsupported commands may result in API requests that are not supported - possibly 422 Unprocessable Entity responses.
    • Unsupported bindings may work in local dev, as there is no local validation, but will fail at Worker deployment time.

    Resolves DEVX-1921.

  • #9330 34c71ce Thanks @edmundhung! - Updated internal configuration to use Miniflares new defaultPersistRoot instead of per-plugin persist flags

  • #8973 cc7fae4 Thanks @Caio-Nogueira! - Show latest instance by default on workflows instances describe command

Patch Changes

4.16.1

Patch Changes

4.16.0

Minor Changes

  • #9288 3b8f7f1 Thanks @petebacondarwin! - allow --name and --env args on wrangler deploy

    Previously it was not possible to provide a Worker name as a command line argument at the same time as setting the Wrangler environment. Now specifying --name is supported and will override any names set in the Wrangler config:

    wrangler.json

    {
    	"name": "config-worker"
    	"env": {
    		"staging": { "name": "config-worker-env" }
    	}
    }
    
    Command Previous (Worker name) Proposed (Worker name) Comment
    wrangler deploy --name=args-worker "args-worker" "args-worker" CLI arg used
    wrangler deploy --name=args-worker --env=staging Error "args-worker" CLI arg used
    wrangler deploy --name=args-worker --env=prod Error "args-worker" CLI arg used
    wrangler deploy "config-worker" "config-worker" Top-level config used
    wrangler deploy --env=staging "config-worker-env" "config-worker-env" Named env config used
    wrangler deploy --env=prod "config-worker-prod" "config-worker-prod" CLI arg and top-level config combined
  • #9265 16de0d5 Thanks @edmundhung! - docs: add documentation links to individual config properties in the JSON schema of the Wrangler config file

Patch Changes

  • #9234 2fe6219 Thanks @emily-shen! - fix: add no-op props to ctx in getPlatformProxy to fix type mismatch

  • #9269 66d975e Thanks @dario-piotrowicz! - Wire up mixed-mode remote bindings for multi-worker wrangler dev

    Under the --x-mixed-mode flag, make sure that bindings configurations with remote: true actually generate bindings to remote resources during a multi-worker wrangler dev session, currently the bindings included in this are: services, kv_namespaces, r2_buckets, d1_databases, queues and workflows.

    Also include the ai binding since the bindings is already remote by default anyways.

  • #9151 5ab035d Thanks @gabivlj! - wrangler containers can be configured with the kind of application rollout on apply

  • #9231 02d40ed Thanks @dario-piotrowicz! - Wire up mixed-mode remote bindings for (single-worker) wrangler dev

    Under the --x-mixed-mode flag, make sure that bindings configurations with remote: true actually generate bindings to remote resources during a single-worker wrangler dev session, currently the bindings included in this are: services, kv_namespaces, r2_buckets, d1_databases, queues and workflows.

    Also include the ai binding since the bindings is already remote by default anyways.

  • #9221 2ef31a9 Thanks @vicb! - bump @cloudflare/unenv-preset

  • #9277 db5ea8f Thanks @penalosa! - Support Mixed Mode for more binding types

  • #9266 f2a16f1 Thanks @petebacondarwin! - fix: setting triggers.crons:[] in Wrangler config should delete deployed cron schedules

  • #9245 b87b472 Thanks @penalosa! - Support Mixed Mode Dispatch Namespaces

  • Updated dependencies [db5ea8f, b87b472]:

4.15.2

Patch Changes

4.15.1

Patch Changes

  • #9248 07f4010 Thanks @vicb! - fix unenv version mismatch

  • #9219 ea71df3 Thanks @vicb! - bump unenv to 2.0.0-rc.17

  • #9246 d033a7d Thanks @edmundhung! - fix: strip CF-Connecting-IP header within fetch

    In v4.15.0, Miniflare began stripping the CF-Connecting-IP header via a global outbound service, which led to a TCP connection regression due to a bug in Workerd. This PR patches the fetch API to strip the header during local wrangler dev sessions as a temporary workaround until the underlying issue is resolved.

  • Updated dependencies [f61a08e, ea71df3, d033a7d]:

4.15.0

Minor Changes

  • #8794 02f0699 Thanks @eastlondoner! - This adds support for more accurate types for service bindings when running wrangler types. Previously, running wrangler types with a config including a service binding would generate an Env type like this:

    interface Env {
      SERVICE_BINDING: Fetcher;
    }
    

    This type was "correct", but didn't capture the possibility of using JSRPC to communicate with the service binding. Now, running wrangler types -c wrangler.json -c ../service/wrangler.json (the first config representing the current Worker, and any additional configs representing service bound Workers) will generate an Env type like this:

    interface Env {
      SERVICE_BINDING: Service<import("../service/src/index").Entrypoint>;
    }
    
  • #8716 63a6504 Thanks @ItsWendell! - add --metafile flag to generate esbuild metadata file during build

  • #9122 f17ee08 Thanks @avenceslau! - Unhide wrangler workflows delete command

Patch Changes

4.14.4

Patch Changes

  • #9124 d0d62e6 Thanks @dario-piotrowicz! - make that unstable_startWorker can correctly throw configuration errors

    make sure that unstable_startWorker can throw configuration related errors when:

    • the utility is called
    • the worker's setConfig is called with the throwErrors argument set to true

    additionally when an error is thrown when unstable_startWorker is called make sure that the worker is properly disposed (since, given the fact that it is not returned by the utility the utility's caller wouldn't have any way to dispose it themselves)

4.14.3

Patch Changes

4.14.2

Patch Changes

  • #9118 1cd30a5 Thanks @dario-piotrowicz! - fix: remove outdated js-doc comment for unstable_startDevWorker's entrypoint

  • #9120 11aa362 Thanks @dario-piotrowicz! - Add experimental_startMixedModeSession no-op utility

    This experimental utility has no effect. More details will be shared as we roll out its functionality.

  • #7423 2be85d7 Thanks @penalosa! - Make sure custom build logging output is more clearly signposted, and make sure it doesn't interfere with the interactive dev session output.

  • #9112 3fe85d4 Thanks @penalosa! - Warn if the Node.js version is below Node.js 20

4.14.1

Patch Changes

  • #9085 cdc88d8 Thanks @petebacondarwin! - Do not include .wrangler and Wrangler config files in additional modules

    Previously, if you added modules rules such as **/*.js or **/*.json, specified no_bundle: true, and the entry-point to the Worker was in the project root directory, Wrangler could include files that were not intended, such as .wrangler/tmp/xxx.js or the Wrangler config file itself. Now these files are automatically skipped when trying to find additional modules by searching the file tree.

  • #9095 508a1a3 Thanks @petebacondarwin! - wrangler login put custom callback host and port into the auth URL

  • #9113 82e220e Thanks @dario-piotrowicz! - Add x-mixed-mode flag

    This experimental flag currently has no effect. More details will be shared as we roll out its functionality.

  • Updated dependencies [357d42a]:

4.14.0

Minor Changes

Patch Changes

4.13.2

Patch Changes

4.13.1

Patch Changes

4.13.0

Minor Changes

  • #8640 5ce70bd Thanks @kentonv! - Add support for defining props on a Service binding.

    In your configuration file, you can define a service binding with props:

    {
      "services": [
        {
          "binding": "MY_SERVICE",
          "service": "some-worker",
          "props": { "foo": 123, "bar": "value" }
        }
      ]
    }
    

    These can then be accessed by the callee:

    import { WorkerEntrypoint } from "cloudflare:workers";
    
    export default class extends WorkerEntrypoint {
      fetch() {
        return new Response(JSON.stringify(this.ctx.props));
      }
    }
    
  • #8771 0cfcfe0 Thanks @dario-piotrowicz! - feat: add config.keep_names option

    Adds a new option to Wrangler to allow developers to opt out of esbuild's keep_names option (https://esbuild.github.io/api/#keep-names). By default, Wrangler sets this to true

    This is something developers should not usually need to care about, but sometimes keep_names can create issues, and in such cases they will be now able to opt-out.

    Example wrangler.jsonc:

    {
      "name": "my-worker",
      "main": "src/worker.ts",
      "keep_names": false
    }
    

Patch Changes

4.12.1

Patch Changes

4.12.0

Minor Changes

  • #8316 69864b4 Thanks @gnekich! - introduce callback-host and callback-port param for wrangler login command

Patch Changes

4.11.1

Patch Changes

4.11.0

Minor Changes

Patch Changes

  • #8885 f2802f9 Thanks @CarmenPopoviciu! - Disambiguate the "No files to upload. Proceeding with deployment..." message

  • #8924 d2b44a2 Thanks @dario-piotrowicz! - fix redirected config env validation breaking wrangler pages commands

    a validation check has recently been introduced to make wrangler error on deploy commands when an environment is specified and a redirected configuration is in use (the reason being that redirected configurations should not include any environment), this check is problematic with pages commands where the "production" environment is anyways set by default, to address this the validation check is being relaxed here on pages commands

  • Updated dependencies [f5413c5]:

4.10.0

Minor Changes

Patch Changes

4.9.1

Patch Changes

4.9.0

Minor Changes

Patch Changes

  • #8809 09464a6 Thanks @dario-piotrowicz! - improve error message when redirected config contains environments

    this change improves that validation error message that users see when a redirected config file contains environments, by:

    • cleaning the message formatting and displaying the offending environments in a list
    • prompting the user to report the issue to the author of the tool which has generated the config
  • #8829 62df08a Thanks @cmackenzie1! - Add option --cors-origin none to remove CORS settings on a pipeline

  • Updated dependencies [afd93b9, 930ebb2]:

4.8.0

Minor Changes

Patch Changes

  • #8780 4e69fb6 Thanks @cmackenzie1! - - Rename wrangler pipelines show to wrangler pipelines get

    • Replace --enable-worker-binding and --enable-http with --source worker and --source http (or --source http worker for both)
    • Remove --file-template and --partition-template flags from wrangler pipelines create|update
    • Add pretty output for wrangler pipelines get <pipeline>. Existing output is available using --format=json.
    • Clarify the minimums, maximums, and defaults (if unset) for wrangler pipelines create commands.
  • #8596 75b454c Thanks @dario-piotrowicz! - add validation to redirected configs in regards to environments

    add the following validation behaviors to wrangler deploy commands, that relate to redirected configs (i.e. config files specified by .wrangler/deploy/config.json files):

    • redirected configs are supposed to be already flattened configurations without any environment (i.e. a build tool should generate redirected configs already targeting specific environments), so if wrangler encounters a redirected config with some environments defined it should error
    • given the point above, specifying an environment (--env=my-env) when using redirected configs is incorrect, so these environments should be ignored and a warning should be presented to the user
  • #8795 d4c1171 Thanks @GregBrimble! - feat: Unhide wrangler pages functions build command.

    This is already documented for Pages Plugins and by officially documenting it, we can ease the transition to Workers Assets for users of Pages Functions.

  • Updated dependencies [93267cf, ec7e621]:

4.7.2

Patch Changes

  • #8763 2650fd3 Thanks @garrettgu10! - R2 data catalog URIs now separate account ID and warehouse name with a slash rather than an underscore

  • #8341 196f51d Thanks @kotkoroid! - Improve error message when request to obtain membership info fails

    Wrangler now informs user that specific permission might be not granted when fails to obtain membership info. The same information is provided when Wrangler is unable to fetch user's email.

  • Updated dependencies [e0efb6f, 0a401d0]:

4.7.1

Patch Changes

4.7.0

Minor Changes

Patch Changes

  • #8720 8df60b5 Thanks @lukevalenta! - Fix logic to derive resource name from binding by replacing all underscores with dashes

  • #8697 ec1f813 Thanks @emily-shen! - fix: stop getPlatformProxy crashing when internal DOs are present

    Internal DOs still do not work with getPlatformProxy, but warn instead of crashing.

  • #8737 624882e Thanks @garvit-gupta! - fix: General improvements for the R2 catalog commands

4.6.0

Minor Changes

Patch Changes

4.5.1

Patch Changes

4.5.0

Minor Changes

Patch Changes

  • #8435 8e3688f Thanks @emily-shen! - fix: include assets binding when printing summary of bindings

  • #8675 f043b74 Thanks @vicb! - Bump @cloudflare/unenv-preset to 2.3.1

    Use the workerd native implementation of createSecureContext and checkServerIdentity from node:tls. The functions have been implemented in cloudflare/workerd#3754.

4.4.1

Patch Changes

4.4.0

Minor Changes

Patch Changes

4.3.0

Minor Changes

  • #8258 9adbd50 Thanks @knickish! - Enable the creation of MySQL Hypedrive configs via the Wrangler CLI.

  • #8353 c4fa349 Thanks @jbwcloudflare! - Add new command to purge a Queue

    This new command can be used to delete all existing messages in a Queue

  • #8461 86ab0ca Thanks @GregBrimble! - Add a 'allowTrailingCommas: true' option to improve IDE experience of 'wrangler.jsonc?'

  • #8550 5ae12a9 Thanks @vicb! - Bump @cloudflare/unenv-preset to 2.2.0

    Use the workerd native implementation for node:tls

Patch Changes

4.2.0

Minor Changes

  • #8477 fd9dff8 Thanks @gabivlj! - wrangler deploy includes container configuration when uploading the script

Patch Changes

  • #8220 14680b9 Thanks @IRCody! - Fix a bug in cloudchamber build where it would still attempt to push an image if the build failed.

  • #8186 05973bb Thanks @IRCody! - Add cloudchamber images {list,delete} commands to list and delete images stored in cloudchamber managed registry.

  • Updated dependencies [ff26dc2, 4ad78ea]:

4.1.0

Minor Changes

  • #8337 1b2aa91 Thanks @Ltadrian! - Add mTLS configuration fields to Hyperdrive command

    hyperdrive create test123 ... --ca-certificate-uuid=CA_CERT_UUID --mtls-certificate-uuid=MTLS_CERT_UUID

Patch Changes

4.0.0

Major Changes

  • #7334 869ec7b Thanks @penalosa! - Use --local by default for wrangler kv key and wrangler r2 object commands

  • #7334 869ec7b Thanks @dario-piotrowicz! - chore: remove deprecated getBindingsProxy

    remove the deprecated getBindingsProxy utility which has been replaced with getPlatformProxy

  • #7334 869ec7b Thanks @penalosa! - Remove the deprecated --format argument on wrangler deploy and wrangler dev.

    Remove deprecated config fields:

    • type
    • webpack_config
    • miniflare
    • build.upload
    • zone_id
    • usage_model
    • experimental_services
    • kv-namespaces
  • #7334 869ec7b Thanks @rozenmd! - Remove wrangler d1 backups

    This change removes wrangler d1 backups, a set of alpha-only commands that would allow folks to interact with backups of their D1 alpha DBs.

    For production D1 DBs, you can restore previous versions of your database with wrangler d1 time-travel and export it at any time with wrangler d1 export.

    Closes #7470

  • #7334 869ec7b Thanks @rozenmd! - Remove --batch-size as an option for wrangler d1 execute and wrangler d1 migrations apply

    This change removes the deprecated --batch-size flag, as it is no longer necessary to decrease the number of queries wrangler sends to D1.

    Closes #7470

  • #7334 869ec7b Thanks @rozenmd! - Remove alpha support from wrangler d1 migrations apply

    This change removes code that would take a backup of D1 alpha databases before proceeding with applying a migration.

    We can remove this code as alpha DBs have not accepted queries in months.

    Closes #7470

  • #7334 869ec7b Thanks @penalosa! - Remove the deprecated wrangler generate command. Instead, use the C3 CLI to create new projects: https://developers.cloudflare.com/pages/get-started/c3/

  • #7334 869ec7b Thanks @penalosa! - Remove the deprecated wrangler init --no-delegate-c3 command. wrangler init is still available, but will always delegate to C3.

  • #7334 869ec7b Thanks @penalosa! - Remove support for legacy assets.

    This removes support for legacy assets using the --legacy-assets flag or legacy_assets config field. Instead, you should use Workers Assets

  • #7334 869ec7b Thanks @penalosa! - Remove the deprecated wrangler publish command. Instead, use wrangler deploy, which takes exactly the same arguments.

    Additionally, remove the following deprecated commands, which are no longer supported.

    • wrangler config
    • wrangler preview
    • wrangler route
    • wrangler subdomain

    Remove the following deprecated command aliases:

    • wrangler secret:*, replaced by wrangler secret *
    • wrangler kv:*, replaced by wrangler kv *
  • #7334 869ec7b Thanks @penalosa! - Remove the deprecated wrangler version command. Instead, use wrangler --version to check the current version of Wrangler.

  • #7334 869ec7b Thanks @penalosa! - The --node-compat flag and node_compat config properties are no longer supported as of Wrangler v4. Instead, use the nodejs_compat compatibility flag. This includes the functionality from legacy node_compat polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.

    If you need to replicate the behaviour of the legacy node_compat feature, refer to https://developers.cloudflare.com/workers/wrangler/migration/update-v3-to-v4/ for a detailed guide.

  • #7334 869ec7b Thanks @threepointone! - chore: update esbuild

    This patch updates esbuild from 0.17.19 to 0.24.2. That's a big bump! Lots has gone into esbuild since May '23. All the details are available at https://github.com/evanw/esbuild/blob/main/CHANGELOG.md / https://github.com/evanw/esbuild/blob/main/CHANGELOG-2023.md.

    • We now support all modern JavasScript/TypeScript features suported by esbuild (as of December 2024). New additions include standard decorators, auto-accessors, and the using syntax.

    • 0.18 introduced wider support for configuration specified via tsconfig.json https://github.com/evanw/esbuild/issues/3019. After observing the (lack of) any actual broken code over the last year for this release, we feel comfortable releasing this without considering it a breaking change.

    • 0.19.3 introduced support for import attributes

      import stuff from './stuff.json' with { type: 'json' }
      

      While we don't currently expose the esbuild configuration for developers to add their own plugins to customise how modules with import attributes are bundled, we may introduce new "types" ourselves in the future.

    • 0.19.0 introduced support for wildcard imports. Specifics here (https://github.com/evanw/esbuild/blob/main/CHANGELOG-2023.md#0190). tl;dr -

      • These 2 patterns will bundle all files that match the glob pattern into a single file.

        const json1 = await import("./data/" + kind + ".json");
        
        const json2 = await import(`./data/${kind}.json`);
        
      • This pattern will NOT bundle any matching patterns:

        const path = "./data/" + kind + ".js";
        const json2 = await import(path);
        

        You can use find_additional_modules to bundle any additional modules that are not referenced in the code but are required by the project.

      Now, this MAY be a breaking change for some. Specifically, if you were previously using the pattern (that will now include all files matching the glob pattern in the bundle), BUT find_additional_modules was NOT configured to include some files, those files would now be included in the bundle. For example, consider this code:

      // src/index.js
      export default {
        async fetch() {
          const url = new URL(request.url);
          const name = url.pathname;
          const value = (await import("." + name)).default;
          return new Response(value);
        },
      };
      

      Imagine if in that folder, you had these 3 files:

      // src/one.js
      export default "one";
      
      // src/two.js
      export default "two";
      
      // src/hidden/secret.js
      export default "do not share this secret";
      

      And your wrangler.toml was:

      name = "my-worker"
      main = "src/index.js
      

      Before this update:

      1. A request to anything but http://localhost:8787/ would error. For example, a request to http://localhost:8787/one.js would error with No such module "one.js".
      2. Let's configure wrangler.toml to include all .js files in the src folder:
      name = "my-worker"
      main = "src/index.js
      
      find_additional_modules = true
      rules = [
        { type = "ESModule", globs = ["*.js"]}
      ]
      

      Now, a request to http://localhost:8787/one.js would return the contents of src/one.js, but a request to http://localhost:8787/hidden/secret.js would error with No such module "hidden/secret.js". To include this file, you could expand the rules array to be:

      rules = [
        { type = "ESModule", globs = ["**/*.js"]}
      ]
      

      Then, a request to http://localhost:8787/hidden/secret.js will return the contents of src/hidden/secret.js.

      After this update:

      • Let's put the wrangler.toml back to its original configuration:
      name = "my-worker"
      main = "src/index.js
      
      • Now, a request to http://localhost:8787/one.js will return the contents of src/one.js, but a request to http://localhost:8787/hidden/secret.js will ALSO return the contents of src/hidden/secret.js. THIS MAY NOT BE WHAT YOU WANT. You can "fix" this in 2 ways:

        1. Remove the inline wildcard import:
        // src/index.js
        export default {
          async fetch() {
            const name = new URL(request.url).pathname;
            const moduleName = "./" + name;
            const value = (await import(moduleName)).default;
            return new Response(value);
          },
        };
        

        Now, no extra modules are included in the bundle, and a request to http://localhost:8787/hidden/secret.js will throw an error. You can use the find_additional_modules feature to include it again. 2. Don't use the wildcard import pattern:

        // src/index.js
        import one from "./one.js";
        import two from "./two.js";
        
        export default {
          async fetch() {
            const name = new URL(request.url).pathname;
            switch (name) {
              case "/one.js":
                return new Response(one);
              case "/two.js":
                return new Response(two);
              default:
                return new Response("Not found", { status: 404 });
            }
          },
        };
        

        Further, there may be some files that aren't modules (js/ts/wasm/text/binary/etc) that are in the folder being included (For example, a photo.jpg file). This pattern will now attempt to include them in the bundle, and throw an error. It will look like this:

        [ERROR] No loader is configured for ".png" files: src/photo.jpg

        To fix this, simply move the offending file to a different folder.

        In general, we DO NOT recommend using the wildcard import pattern. If done wrong, it can leak files into your bundle that you don't want, or make your worker slightly slower to start. If you must use it (either with a wildcard import pattern or with find_additional_modules) you must be diligent to check that your worker is working as expected and that you are not leaking files into your bundle that you don't want. You can configure eslint to disallow dynamic imports like this:

        // eslint.config.js
        export default [
          {
            rules: {
              "no-restricted-syntax": [
                "error",
                {
                  selector: "ImportExpression[argument.type!='Literal']",
                  message:
                    "Dynamic imports with non-literal arguments are not allowed.",
                },
              ],
            },
          },
        ];
        
  • #7334 869ec7b Thanks @pmiguel! - Remove worker name prefix from KV namespace create

    When running wrangler kv namespace create <name>, previously the name of the namespace was automatically prefixed with the worker title, or worker- when running outside the context of a worker. After this change, KV namespaces will no longer get prefixed, and the name used is the name supplied, verbatim.

  • #7334 869ec7b Thanks @penalosa! - Packages in Workers SDK now support the versions of Node that Node itself supports (Current, Active, Maintenance). Currently, that includes Node v18, v20, and v22.

Minor Changes

  • #7334 869ec7b Thanks @emily-shen! - Include runtime types in the output of wrangler types by default

    wrangler types will now produce one file that contains both Env types and runtime types based on your compatibility date and flags. This is located at worker-configuration.d.ts by default.

    This behaviour was previously gated behind --experimental-include-runtime. That flag is no longer necessary and has been removed. It has been replaced by --include-runtime and --include-env, both of which are set to true by default. If you were previously using --x-include-runtime, you can drop that flag and remove the separate runtime.d.ts file.

    If you were previously using @cloudflare/workers-types we recommend you run uninstall (e.g. npm uninstall @cloudflare/workers-types) and run wrangler types instead. Note that @cloudflare/workers-types will continue to be published.

  • #7334 869ec7b Thanks @penalosa! - feat: prompt users to rerun wrangler types during wrangler dev

    If a generated types file is found at the default output location of wrangler types (worker-configuration.d.ts), remind users to rerun wrangler types if it looks like they're out of date.

Patch Changes

3.114.1

Patch Changes

  • #8383 8d6d722 Thanks @matthewdavidrodgers! - Make kv bulk put --local respect base64:true

    The bulk put api has an optional "base64" boolean property for each key. Before storing the key, the value should be decoded from base64.

    For real (remote) kv, this is handled by the rest api. For local kv, it seems the base64 field was ignored, meaning encoded base64 content was stored locally rather than the raw values.

    To fix, we need to decode each value before putting to the local miniflare namespace when base64 is true.

  • #8273 e3efd68 Thanks @penalosa! - Support AI, Vectorize, and Images bindings when using @cloudflare/vite-plugin

  • #8427 a352798 Thanks @vicb! - update unenv-preset dependency to fix bug with Performance global

    Fixes #8407 Fixes #8409 Fixes #8411

  • #8390 53e6323 Thanks @GregBrimble! - Parse and apply metafiles (_headers and _redirects) in wrangler dev for Workers Assets

  • #8392 4d9d9e6 Thanks @jahands! - fix: retry zone and route lookup API calls

    In rare cases, looking up Zone or Route API calls may fail due to transient errors. This change improves the reliability of wrangler deploy when these errors occur.

    Also fixes a rare issue where concurrent API requests may fail without correctly throwing an error which may cause a deployment to incorrectly appear successful.

  • Updated dependencies [8242e07, 53e6323]:

3.114.0

Minor Changes

  • #8367 7b6b0c2 Thanks @jonesphillip! - Deprecated --id parameter in favor of --name for both the wrangler r2 bucket lifecycle and wrangler r2 bucket lock commands

3.113.0

Minor Changes

  • #8300 bca1fb5 Thanks @vicb! - Use the unenv preset for Cloudflare from @cloudflare/unenv-preset

Patch Changes

  • #8338 2d40989 Thanks @GregBrimble! - feat: Upload _headers and _redirects if present with Workers Assets as part of wrangler deploy and wrangler versions upload.

  • #8288 cf14e17 Thanks @CarmenPopoviciu! - feat: Add assets Proxy Worker skeleton in miniflare

    This commit implements a very basic Proxy Worker skeleton, and wires it in the "pipeline" miniflare creates for assets. This Worker will be incrementally worked on, but for now, the current implementation will forward all incoming requests to the Router Worker, thus leaving the current assets behaviour in local dev, the same.

    This is an experimental feature available under the --x-assets-rpc flag: wrangler dev --x-assets-rpc.

  • #8216 af9a57a Thanks @ns476! - Support Images binding in wrangler types

  • #8304 fbba583 Thanks @jahands! - chore: add concurrency and caching for Zone IDs and Workers routes lookups

    Workers with many routes can result in duplicate Zone lookups during deployments, making deployments unnecessarily slow. This compounded by the lack of concurrency when making these API requests.

    This change deduplicates these requests and adds concurrency to help speed up deployments.

  • Updated dependencies [2d40989, da568e5, cf14e17, 79c7810]:

3.112.0

Minor Changes

  • #8256 f59d95b Thanks @jbwcloudflare! - Add two new Queues commands: pause-delivery and resume-delivery

    These new commands allow users to pause and resume the delivery of messages to Queue Consumers

Patch Changes

3.111.0

Minor Changes

Patch Changes

  • #8248 1cb2d34 Thanks @GregBrimble! - feat: Omits Content-Type header for files of an unknown extension in Workers Assets

  • #7977 36ef9c6 Thanks @jkoe-cf! - fixing the format of the R2 lifecycle rule date input to be parsed as string instead of number

3.110.0

Minor Changes

  • #8253 6dd1e23 Thanks @CarmenPopoviciu! - Add --cwd global argument to the wrangler CLI to allow changing the current working directory before running any command.

Patch Changes

3.109.3

Patch Changes

  • #8175 eb46f98 Thanks @edmundhung! - fix: unstable_splitSqlQuery should ignore comments when splitting sql into statements

3.109.2

Patch Changes

3.109.1

Patch Changes

3.109.0

Minor Changes

  • #8120 3fb801f Thanks @sdnts! - Add a new update subcommand for Queues to allow updating Queue settings

  • #8120 3fb801f Thanks @sdnts! - Allow overriding message retention duration when creating Queues

  • #8026 542c6ea Thanks @penalosa! - Add --outfile to wrangler deploy for generating a worker bundle.

    This is an advanced feature that most users won't need to use. When set, Wrangler will output your built Worker bundle in a Cloudflare specific format that captures all information needed to deploy a Worker using the Worker Upload API

  • #8026 542c6ea Thanks @penalosa! - Add a wrangler check startup command to generate a CPU profile of your Worker's startup phase.

    This can be imported into Chrome DevTools or opened directly in VSCode to view a flamegraph of your Worker's startup phase. Additionally, when a Worker deployment fails with a startup time error Wrangler will automatically generate a CPU profile for easy investigation.

    Advanced usage:

    • --args: to customise the way wrangler check startup builds your Worker for analysis, provide the exact arguments you use when deploying your Worker with wrangler deploy. For instance, if you deploy your Worker with wrangler deploy --no-bundle, you should use wrangler check startup --args="--no-bundle" to profile the startup phase.
    • --worker-bundle: if you don't use Wrangler to deploy your Worker, you can use this argument to provide a Worker bundle to analyse. This should be a file path to a serialised multipart upload, with the exact same format as the API expects: https://developers.cloudflare.com/api/resources/workers/subresources/scripts/methods/update/

Patch Changes

  • #8112 fff677e Thanks @penalosa! - When reporting errors to Sentry, Wrangler will now include the console output as additional metadata

  • #8120 3fb801f Thanks @sdnts! - Check bounds when overriding delivery delay when creating Queues

  • #7950 4db1fb5 Thanks @cmackenzie1! - Add local binding support for Worker Pipelines

  • #8119 1bc60d7 Thanks @penalosa! - Output correct config format from wrangler d1 create. Previously, this command would always output TOML, regardless of the config file format

  • #8130 1aa2a91 Thanks @emily-shen! - Include default values for wrangler types --path and --x-include-runtime in telemetry

    User provided strings are still left redacted as always.

  • #8061 35710e5 Thanks @emily-shen! - fix: respect WRANGLER_LOG in wrangler dev

    Previously, --log-level=debug was the only way to see debug logs in wrangler dev, which was unlike all other commands.

  • Updated dependencies [4db1fb5]:

3.108.1

Patch Changes

3.108.0

Minor Changes

  • #7990 b1966df Thanks @cmsparks! - Add WRANGLER_CI_OVERRIDE_NAME for Workers CI

  • #8028 b2dca9a Thanks @emily-shen! - feat: Also log when no bindings are found.

    We currently print a worker's bindings during dev, versions upload and deploy. This just also prints something when there's no bindings found, in case you were expecting bindings.

  • #8037 71fd250 Thanks @WillTaylorDev! - Provides unsafe.metadata configurations when using wrangler versions secret put.

Patch Changes

  • #8058 1f80d69 Thanks @WillTaylorDev! - Bugfix: Modified versions secret put to inherit all known bindings, which circumvents a limitation in the API which does not return all fields for all bindings.

  • #7986 88514c8 Thanks @andyjessop! - docs: clarifies that local resources are "simulated locally" or "connected to remote resource", and adds console messages to help explain local dev

  • #8008 9d08af8 Thanks @ns476! - Add support for Images bindings (in private beta for now), with optional local support for platforms where Sharp is available.

  • #7769 6abe69c Thanks @cmackenzie1! - Adds the following new option for wrangler pipelines create and wrangler pipelines update commands:

    --cors-origins           CORS origin allowlist for HTTP endpoint (use * for any origin)  [array]
    
  • #7290 0c0374c Thanks @emily-shen! - fix: add support for workers with assets when running multiple workers in one wrangler dev instance

    https://github.com/cloudflare/workers-sdk/pull/7251 added support for running multiple Workers in one wrangler dev/miniflare session. e.g. wrangler dev -c wrangler.toml -c ../worker2/wrangler.toml, which among other things, allowed cross-service RPC to Durable Objects.

    However this did not work in the same way as production when there was a Worker with assets - this PR should fix that.

  • #7769 6abe69c Thanks @cmackenzie1! - Rename wrangler pipelines <create|update> flags

    The following parameters have been renamed:

    Previous Name New Name
    access-key-id r2-access-key-id
    secret-access-key r2-secret-access-key
    transform transform-worker
    r2 r2-bucket
    prefix r2-prefix
    binding enable-worker-binding
    http enable-http
    authentication require-http-auth
    filename file-template
    filepath partition-template
  • #8012 c412a31 Thanks @mtlemilio! - Use fetchPagedListResult when listing Hyperdrive configs from the API

    This fixes an issue where only 20 configs were being listed.

  • #8077 60310cd Thanks @emily-shen! - feat: add telemetry to experimental auto-provisioning

  • Updated dependencies [c80dbd8, 0c0374c]:

3.107.3

Patch Changes

3.107.2

Patch Changes

  • #7988 444a630 Thanks @edmundhung! - Fix #7985.

    This reverts the changes on #7945 that caused compatibility issues with Node 16 due to the introduction of sharp.

3.107.1

Patch Changes

3.107.0

Minor Changes

  • #7897 34f9797 Thanks @WillTaylorDev! - chore: provides run_worker_first for Worker-script-first configuration. Deprecates experimental_serve_directly.

Patch Changes

  • #7945 d758215 Thanks @ns476! - Add Images binding (in private beta for the time being)

  • #7947 f57bc4e Thanks @dario-piotrowicz! - fix: avoid getPlatformProxy logging twice that it is using vars defined in .dev.vars files

    when getPlatformProxy is called and it retrieves values from .dev.vars files, it logs twice a message like: Using vars defined in .dev.vars, the changes here make sure that in such cases this log only appears once

  • #7889 38db4ed Thanks @emily-shen! - feat: add experimental resource auto-provisioning to versions upload

  • #7864 de6fa18 Thanks @dario-piotrowicz! - Update the unstable_getMiniflareWorkerOptions types to always include an env parameter.

    The unstable_getMiniflareWorkerOptions types, when accepting a config object as the first argument, didn't accept a second env argument. The changes here make sure they do, since the env is still relevant for picking up variables from .dev.vars files.

  • #7964 bc4d6c8 Thanks @LuisDuarte1! - Fix scripts binding to a workflow in a different script overriding workflow config

  • Updated dependencies [cf4f47a]:

3.106.0

Minor Changes

  • #7856 2b6f149 Thanks @emily-shen! - feat: add sanitised error messages to Wrangler telemetry

    Error messages that have been audited for potential inclusion of personal information, and explicitly opted-in, are now included in Wrangler's telemetry collection. Collected error messages will not include any filepaths, user input or any other potentially private content.

  • #7900 bd9228e Thanks @vicb! - chore(wrangler): update unenv dependency version

    unenv@2.0.0-rc.1 allows using the workerd implementation for the Node modules net, timers, and timers/promises. See unjs/unenv#396.

Patch Changes

  • #7904 50b13f6 Thanks @WalshyDev! - fix: validation for R2 bucket names, the regex was wrongly rejecting buckets starting with a number and the message wasn't as clear as it could be on what was going wrong.

  • #7895 134d61d Thanks @jahands! - Fix regression in retryOnAPIFailure preventing any requests from being retried

    Also fixes a regression in pipelines that prevented 401 errors from being retried when waiting for an API token to become active.

  • #7879 5c02e46 Thanks @andyjessop! - Fix to not require local connection string when using Hyperdrive and wrangler dev --remote

  • #7860 13ab591 Thanks @vicb! - refactor(wrangler): make JSON parsing independent of Node

    Switch jsonc-parser to parse json:

    • JSON.parse() exception messages are not stable across Node versions
    • While jsonc-parser is used, JSONC specific syntax is disabled
  • Updated dependencies []:

3.105.1

Patch Changes

3.105.0

Minor Changes

  • #7466 e5ebdb1 Thanks @Ltadrian! - feat: implement the wrangler cert upload command

    This command allows users to upload a mTLS certificate/private key or certificate-authority certificate chain.

    For uploading mTLS certificate, run:

    • wrangler cert upload mtls-certificate --cert cert.pem --key key.pem --name MY_CERT

    For uploading CA certificate chain, run:

    • wrangler cert upload certificate-authority --ca-cert server-ca.pem --name SERVER_CA

Patch Changes

3.104.0

Minor Changes

  • #7715 26fa9e8 Thanks @penalosa! - Support service bindings from Pages projects to Workers in a single workerd instance. To try it out, pass multiple -c flags to Wrangler: i.e. wrangler pages dev -c wrangler.toml -c ../other-worker/wrangler.toml. The first -c flag must point to your Pages config file, and the rest should point to Workers that are bound to your Pages project.

  • #7816 f6cc029 Thanks @dario-piotrowicz! - add support for assets bindings to getPlatformProxy

    this change makes sure that that getPlatformProxy, when the input configuration file contains an assets field, correctly returns the appropriate asset binding proxy

    example:

    // wrangler.json
    {
      "name": "my-worker",
      "assets": {
        "directory": "./public/",
        "binding": "ASSETS"
      },
      "vars": {
        "MY_VAR": "my-var"
      }
    }
    
    import { getPlatformProxy } from "wrangler";
    
    const { env, dispose } = await getPlatformProxy();
    
    if (env.ASSETS) {
      const text = await (
        await env.ASSETS.fetch("http://0.0.0.0/file.txt")
      ).text();
      console.log(text); // logs the content of file.txt
    }
    
    await dispose();
    

Patch Changes

  • #7785 cccfe51 Thanks @joshthoward! - Fix Durable Objects transfer migration validation

  • #7821 fcaa02c Thanks @vicb! - fix(wrangler): fix wrangler config schema defaults

  • #7832 97d2a1b Thanks @petebacondarwin! - Relax the messaging when Wrangler uses redirected configuration

    Previously the messaging was rendered as a warning, which implied that the user had done something wrong. Now it is just a regular info message.

  • #7806 d7adb50 Thanks @vicb! - chore: update unenv to 2.0.0-rc.0

    Pull a couple changes in node:timers

    The unenv update also includes #unjs/unenv/381 which implements stdout, stderr and stdin of node:process with node:tty

  • #7828 9077a67 Thanks @edmundhung! - improve multi account error message in non-interactive mode

  • Updated dependencies []:

3.103.2

Patch Changes

  • #7804 16a9460 Thanks @vicb! - fix(wrangler): use require.resolve to resolve unenv path

3.103.1

Patch Changes

3.103.0

Minor Changes

  • #5086 8faf2c0 Thanks @dario-piotrowicz! - add --strict-vars option to wrangler types

    add a new --strict-vars option to wrangler types that developers can (by setting the flag to false) use to disable the default strict/literal types generation for their variables

    opting out of strict variables can be useful when developers change often their vars values, even more so when multiple environments are involved

    Example

    With a toml containing:

    [vars]
    MY_VARIABLE = "production_value"
    MY_NUMBERS = [1, 2, 3]
    
    [env.staging.vars]
    MY_VARIABLE = "staging_value"
    MY_NUMBERS = [7, 8, 9]
    

    the wrangler types command would generate the following interface:

    interface Env {
            MY_VARIABLE: "production_value" | "staging_value";
            MY_NUMBERS: [1,2,3] | [7,8,9];
    }
    

    while wrangler types --strict-vars=false would instead generate:

    interface Env {
            MY_VARIABLE: string;
            MY_NUMBERS: number[];
    }
    

    (allowing the developer to easily change their toml variables without the risk of breaking typescript types)

Patch Changes

  • #7720 902e3af Thanks @vicb! - chore(wrangler): use the unenv preset from @cloudflare/unenv-preset

  • #7760 19228e5 Thanks @vicb! - chore: update unenv dependency version

  • #7735 e8aaa39 Thanks @penalosa! - Unwrap the error cause when available to send to Sentry

  • #5086 8faf2c0 Thanks @dario-piotrowicz! - fix: widen multi-env vars types in wrangler types

    Currently, the type generated for vars is a string literal consisting of the value of the variable in the top level environment. If multiple environments are specified this wrongly restricts the type, since the variable could contain any of the values from each of the environments.

    For example, given a wrangler.toml containing the following:

    [vars]
    MY_VAR = "dev value"
    
    [env.production.vars]
    MY_VAR = "prod value"
    

    running wrangler types would generate:

    interface Env {
      MY_VAR: "dev value";
    }
    

    making typescript incorrectly assume that MY_VAR is always going to be "dev value"

    after these changes, the generated interface would instead be:

    interface Env {
      MY_VAR: "dev value" | "prod value";
    }
    
  • #7733 dceb196 Thanks @emily-shen! - feat: pull resource names for provisioning from config if provided

    Uses database_name and bucket_name for provisioning if specified. For R2, this only happens if there is not a bucket with that name already. Also respects R2 jurisdiction if provided.

  • Updated dependencies []:

3.102.0

Minor Changes

Patch Changes

  • #7750 df0e5be Thanks @andyjessop! - bug: Removes the (local) tag on Vectorize bindings in the console output of wrangler dev, and adds-in the same tag for Durable Objects (which are emulated locally in wrangler dev).

  • #7732 d102b60 Thanks @Ankcorn! - fix pages secret bulk copy

  • #7706 c63f1b0 Thanks @penalosa! - Remove the server-based dev registry in favour of the more stable file-based dev registry. There should be no user-facing impact.

  • Updated dependencies [8e9aa40]:

3.101.0

Minor Changes

  • #7534 7c8ae1c Thanks @cmackenzie1! - feat: Use OAuth flow to generate R2 tokens for Pipelines

  • #7674 45d1d1e Thanks @Ankcorn! - Add support for env files to wrangler secret bulk i.e. .dev.vars

    Run wrangler secret bulk .dev.vars to add the env file

    //.dev.vars
    KEY=VALUE
    KEY_2=VALUE
    

    This will upload the secrets KEY and KEY_2 to your worker

  • #7442 e4716cc Thanks @petebacondarwin! - feat: add support for redirecting Wrangler to a generated config when running deploy-related commands

    This new feature is designed for build tools and frameworks to provide a deploy-specific configuration, which Wrangler can use instead of user configuration when running deploy-related commands. It is not expected that developers of Workers will need to use this feature directly.

    Affected commands

    The commands that use this feature are:

    • wrangler deploy
    • wrangler dev
    • wrangler versions upload
    • wrangler versions deploy
    • wrangler pages deploy
    • wrangler pages build
    • wrangler pages build-env

    Config redirect file

    When running these commands, Wrangler will look up the directory tree from the current working directory for a file at the path .wrangler/deploy/config.json. This file must contain only a single JSON object of the form:

    { "configPath": "../../path/to/wrangler.json" }
    

    When this file exists Wrangler will follow the configPath (relative to the .wrangler/deploy/config.json file) to find an alternative Wrangler configuration file to load and use as part of this command.

    When this happens Wrangler will display a warning to the user to indicate that the configuration has been redirected to a different file than the user's configuration file.

    Custom build tool example

    A common approach that a build tool might choose to implement.

    • The user writes code that uses Cloudflare Workers resources, configured via a user wrangler.toml file.

      name = "my-worker"
      main = "src/index.ts"
      [[kv_namespaces]]
      binding = "<BINDING_NAME1>"
      id = "<NAMESPACE_ID1>"
      

      Note that this configuration points main at user code entry-point.

    • The user runs a custom build, which might read the wrangler.toml to find the entry-point:

      > my-tool build
      
    • This tool generates a dist directory that contains both compiled code and a new deployment configuration file, but also a .wrangler/deploy/config.json file that redirects Wrangler to this new deployment configuration file:

      - dist
        - index.js
      	- wrangler.json
      - .wrangler
        - deploy
      	  - config.json
      

      The dist/wrangler.json will contain:

      {
        "name": "my-worker",
        "main": "./index.js",
        "kv_namespaces": [
          { "binding": "<BINDING_NAME1>", "id": "<NAMESPACE_ID1>" }
        ]
      }
      

      And the .wrangler/deploy/config.json will contain:

      {
        "configPath": "../../dist/wrangler.json"
      }
      
  • #7685 9d2740a Thanks @vicb! - allow overriding the unenv preset.

    By default wrangler uses the bundled unenv preset.

    Setting WRANGLER_UNENV_RESOLVE_PATHS allow to use another version of the preset. Those paths are used when resolving the unenv module identifiers to absolute paths. This can be used to test a development version.

  • #7694 f3c2f69 Thanks @joshthoward! - Default wrangler d1 export to --local rather than failing

Patch Changes

3.100.0

Minor Changes

  • #7604 6c2f173 Thanks @CarmenPopoviciu! - feat: Capture Workers with static assets in the telemetry data

    We want to measure accurately what this number of Workers + Assets projects running in remote mode is, as this number will be a very helpful data point down the road, when more decisions around remote mode will have to be taken.

    These changes add this kind of insight to our telemetry data, by capturing whether the command running is in the context of a Workers + Assets project.

    N.B. With these changes in place we will be capturing the Workers + Assets context for all commands, not just wrangler dev --remote.

Patch Changes

3.99.0

Minor Changes

  • #7425 8757579 Thanks @CarmenPopoviciu! - feat: Make DX improvements in wrangler dev --remote

    Workers + Assets projects have, in certain situations, a relatively degraded wrangler dev --remote developer experience, as opposed to Workers proper projects. This is due to the fact that, for Workers + Assets, we need to make extra API calls to:

    1. check for asset files changes
    2. upload the changed assets, if any

    This commit improves the wrangler dev --remote DX for Workers + Assets, for use cases when the User Worker/assets change while the API calls for previous changes are still in flight. For such use cases, we have put an exit early strategy in place, that drops the event handler execution of the previous changes, in favour of the handler triggered by the new changes.

  • #7537 086a6b8 Thanks @WillTaylorDev! - Provide validation around assets.experimental_serve_directly

  • #7568 2bbcb93 Thanks @WillTaylorDev! - Warn users when using smart placement with Workers + Assets and serve_directly is set to false

Patch Changes

  • #7521 48e7e10 Thanks @emily-shen! - feat: add experimental_patchConfig()

    experimental_patchConfig() can add to a user's config file. It preserves comments if its a wrangler.jsonc. However, it is not suitable for wrangler.toml with comments as we cannot preserve comments on write.

  • Updated dependencies [1488e11, 7216835]:

3.98.0

Minor Changes

  • #7476 5124b5d Thanks @WalshyDev! - feat: allow routing to Workers with Assets on any HTTP route, not just the root. For example, example.com/blog/* can now be used to serve assets. These assets will be served as though the assets directly were mounted to the root. For example, if you have assets = { directory = "./public/" }, a route like "example.com/blog/*" and a file ./public/blog/logo.png, this will be available at example.com/blog/logo.png. Assets outside of directories which match the configured HTTP routes can still be accessed with the Assets binding or with a Service binding to this Worker.

  • #7380 72935f9 Thanks @CarmenPopoviciu! - Add Workers + Assets support in wrangler dev --remote

Patch Changes

  • #7573 fb819f9 Thanks @emily-shen! - feat: add experimental_readRawConfig()

    Adds a Wrangler API to find and read a config file

  • #7549 42b9429 Thanks @penalosa! - Expand metrics collection to:

    • Detect Pages & Workers CI
    • Filter out default args (e.g. --x-versions, --x-dev-env, and --latest) by only including args that were in argv
  • #7583 8def8c9 Thanks @penalosa! - Revert support for custom unenv resolve path to address an issue with Wrangler failing to deploy Pages projects with nodejs_compat_v2 in some cases

3.97.0

Minor Changes

  • #7522 6403e41 Thanks @vicb! - feat(wrangler): allow overriding the unenv preset.

    By default wrangler uses the bundled unenv preset.

    Setting WRANGLER_UNENV_RESOLVE_PATHS allow to use another version of the preset. Those paths are used when resolving the unenv module identifiers to absolute paths. This can be used to test a development version.

  • #7479 2780849 Thanks @penalosa! - Accept a JSON file of the format { name: string }[] in wrangler kv bulk delete, as well as the current string[] format.

Patch Changes

3.96.0

Minor Changes

Patch Changes

  • #7542 f13c897 Thanks @CarmenPopoviciu! - Always print deployment and placement ID in Cloudchamber commands

    Currently, Cloudchamber commands only print the full deployment ID when the deployment has an IPv4 address. This commit ensures the deployment ID and the placement ID are always printed to stdout. It also moves the printing of the IPv4 address (if one exists) to the same place as the IPv6 address so that they are printed together.

  • #6754 0356d0a Thanks @bluwy! - refactor: move @cloudflare/workers-shared as dev dependency

  • #7478 2e90efc Thanks @petebacondarwin! - fix: ensure that non-inherited fields are not removed when using an inferred named environment

    It is an error for the the user to provide an environment name that doesn't match any of the named environments in the Wrangler configuration. But if there are no named environments defined at all in the Wrangler configuration, we special case the top-level environment as though it was a named environment. Previously, when this happens, we would remove all the nonInheritable fields from the configuration (essentially all the bindings) leaving an incorrect configuration. Now we correctly generate a flattened named environment that has the nonInheritable fields, plus correctly applies any transformFn on inheritable fields.

  • #7524 11f95f7 Thanks @gpanders! - Include response body in Cloudchamber API errors

  • #7427 3bc0f28 Thanks @edmundhung! - The x-provision experimental flag now identifies draft and inherit bindings by looking up the current binding settings.

    Draft bindings can then be provisioned (connected to new or existing KV, D1, or R2 resources) during wrangler deploy.

  • Updated dependencies []:

3.95.0

Minor Changes

3.94.0

Minor Changes

  • #7229 669d7ad Thanks @gabivlj! - Introduce a new cloudchamber command wrangler cloudchamber apply, which will be used by customers to deploy container-apps

Patch Changes

3.93.0

Minor Changes

  • #7291 f5b9cd5 Thanks @edmundhung! - Add anonymous telemetry to Wrangler commands

    For new users, Cloudflare will collect anonymous usage telemetry to guide and improve Wrangler's development. If you have already opted out of Wrangler's existing telemetry, this setting will still be respected.

    See our data policy for more details on what we collect and how to opt out if you wish.

  • #7448 20a0f17 Thanks @GregBrimble! - feat: Allow Workers for Platforms scripts (scripts deployed with --dispatch-namespace) to bring along assets

  • #7445 f4ae6ee Thanks @WillTaylorDev! - Support for assets.experimental_serve_directly with wrangler dev

Patch Changes

  • #7256 415e5b5 Thanks @jamesopstad! - Export unstable_readConfig function and Unstable_Config, Unstable_RawConfig, Unstable_RawEnvironment and Unstable_MiniflareWorkerOptions types from Wrangler. Overload unstable_getMiniflareWorkerOptions function to accept a config that has already been loaded.

  • #7431 8f25ebe Thanks @vicb! - chore(wrangler): update unenv dependency version

    Pull in:

    • refactor(cloudflare): reimplement module:createRequire for latest workerd (unjs/unenv#351)
    • refactor: use node:events instead of relative path (unjs/unenv#354)
    • refactor(http, cloudflare): use unenv/ imports inside node:http (unjs/unenv#363)
    • refactor(node:process): set process.domain to undefined (unjs/unenv#367)
  • #7426 b40d0ab Thanks @petebacondarwin! - fix: allow the asset directory to be omitted in Wrangler config for commands that don't need it

  • #7454 f2045be Thanks @petebacondarwin! - refactor: Ensure that unstable type exports are all prefixed with Unstable_ rather than just Unstable

  • #7461 9ede45b Thanks @petebacondarwin! - fix: relax validation of unsafe configuration to allow an empty object

    The types, the default and the code in general support an empty object for this config setting.

    So it makes sense to avoid erroring when validating the config.

  • #7446 9435af0 Thanks @petebacondarwin! - fix: make sure Wrangler doesn't create a .wrangler tmp dir in the functions/ folder of a Pages project

    This regression was introduced in https://github.com/cloudflare/workers-sdk/pull/7415 and this change fixes it by reverting that change.

  • #7385 14a7bc6 Thanks @edmundhung! - The x-provision experimental flag now support inherit bindings in deploys

  • #7463 073293f Thanks @penalosa! - Clarify messaging around wrangler versions commands to reflect that they're stable (and have been since GA during birthday week)

  • #7436 5e69799 Thanks @Ankcorn! - Relax type on observability.enabled to remove linting error for nested configurations

  • #7450 8c873ed Thanks @petebacondarwin! - fix: ensure that version secrets commands do not write wrangler config warnings

  • Updated dependencies [21a9e24, f4ae6ee]:

3.92.0

Minor Changes

  • #7251 80a83bb Thanks @penalosa! - Improve Wrangler's multiworker support to allow running multiple workers at once with one command. To try it out, pass multiple -c flags to Wrangler: i.e. wrangler dev -c wrangler.toml -c ../other-worker/wrangler.toml. The first config will be treated as the primary worker and will be exposed over HTTP as usual (localhost:8787) while the rest will be treated as secondary and will only be accessible via a service binding from the primary worker. Notably, these workers all run in the same runtime instance, which should improve reliability of multiworker dev and fix some bugs (RPC to cross worker Durable Objects, for instance).

  • #7130 11338d0 Thanks @nickbabcock! - Update import resolution for files and package exports

    In an npm workspace environment, wrangler will now be able to successfully resolve package exports.

    Previously, wrangler would only be able to resolve modules in a relative node_modules directory and not the workspace root node_modules directory.

  • #7355 5928e8c Thanks @emily-shen! - feat: add experimental_serve_directly option to Workers with Assets

    Users can now specify whether their assets are served directly against HTTP requests or whether these requests always go to the Worker, which can then respond with asset retrieved by its assets binding.

Patch Changes

3.91.0

Minor Changes

  • #7230 6fe9533 Thanks @penalosa! - Turn on wrangler.json(c) support by default

    Wrangler now supports both JSON (wrangler.json) and TOML (wrangler.toml) for it's configuration file. The format of Wrangler's configuration file is exactly the same across both languages, except that the syntax is JSON rather than TOML. e.g.

    name = "worker-ts"
    main = "src/index.ts"
    compatibility_date = "2023-05-04"
    

    would be interpreted the same as the equivalent JSON

    {
      "name": "worker-ts",
      "main": "src/index.ts",
      "compatibility_date": "2023-05-04"
    }
    
  • #7330 219109a Thanks @jonesphillip! - Added Oceania (oc) location hint as acceptable choice when creating an R2 bucket.

  • #7227 02a0e1e Thanks @taylorlee! - Add preview_urls toggle to wrangler.toml

    The current Preview URLs (beta) feature routes to version preview urls based on the status of the workers_dev config value. Beta users have requested the ability to enable deployment urls and preview urls separately on workers.dev, and the new previews_enabled field of the enable-subdomain API will allow that. This change separates the workers_dev and preview_urls behavior during wrangler triggers deploy and wrangler versions upload. preview_urls defaults to true, and does not implicitly depend on routes the way workers_dev does.

  • #7308 1b1d01a Thanks @gpanders! - Add a default image for cloudchamber create and modify commands

  • #7232 7da76de Thanks @toddmantell! - feat: implement queues info command

    This command allows users to get information on individual queues.

    To run this command use the queues info command with the name of a queue in the user's account.

    wrangler queues info my-queue-name

Patch Changes

3.90.0

Minor Changes

  • #7315 31729ee Thanks @G4brym! - Update local AI fetcher to forward method and url to upstream

Patch Changes

3.89.0

Minor Changes

  • #7252 97acf07 Thanks @Maximo-Guk! - feat: Add production_branch and deployment_trigger to pages deploy detailed artifact for wrangler-action pages parity

  • #7263 1b80dec Thanks @danielrs! - Fix wrangler pages deployment (list|tail) environment filtering.

Patch Changes

  • #7314 a30c805 Thanks @Ankcorn! - Fix observability.logs.enabled validation

  • #7285 fa21312 Thanks @penalosa! - Rename directory to projectRoot and ensure it's relative to the wrangler.toml. This fixes a regression which meant that .wrangler temporary folders were inadvertently generated relative to process.cwd() rather than the location of the wrangler.toml file. It also renames directory to projectRoot, which affects the `unstable_startWorker() interface.

  • Updated dependencies [563439b]:

3.88.0

Minor Changes

  • #7173 b6cbfbd Thanks @Ankcorn! - Adds [observability.logs] settings to wrangler. This setting lets developers control the settings for logs as an independent dataset enabling more dataset types in the future. The most specific setting will win if any of the datasets are not enabled.

    It also adds the following setting to the logs config

    • invocation_logs - set to false to disable invocation logs. Defaults to true.
    [observability.logs]
    enabled = true
    invocation_logs = false
    
  • #7207 edec415 Thanks @jonesphillip! - Added r2 bucket lifecycle command to Wrangler including list, add, remove, set

Patch Changes

3.87.0

Minor Changes

  • #7201 beed72e Thanks @GregBrimble! - feat: Tail Consumers are now supported for Workers with assets.

    You can now configure tail_consumers in conjunction with assets in your wrangler.toml file. Read more about Static Assets and Tail Consumers in the documentation.

  • #7212 837f2f5 Thanks @jonesphillip! - Added r2 bucket info command to Wrangler. Improved formatting of r2 bucket list output

Patch Changes

3.86.1

Patch Changes

  • #7069 b499b74 Thanks @penalosa! - Internal refactor to remove the non --x-dev-env flow from wrangler dev

3.86.0

Minor Changes

  • #7154 ef7c0b3 Thanks @jonesphillip! - Added the ability to enable, disable, and get r2.dev public access URLs for R2 buckets.

Patch Changes

3.85.0

Minor Changes

  • #7105 a5f1779 Thanks @jonesphillip! - Added the ability to list, add, remove, and update R2 bucket custom domains.

  • #7132 89f6274 Thanks @gabivlj! - Event messages are capitalized, images of wrong architectures properly show the error in cloudchamber create When a new "health" enum is introduced, wrangler cloudchamber list won't crash anymore. Update Cloudchamber schemas.

  • #7121 2278616 Thanks @bruxodasilva! - Added pause and resume commands to manage Workflows and hidded unimplemented delete command

Patch Changes

3.84.1

Patch Changes

3.84.0

Minor Changes

Patch Changes

  • #7091 68a2a84 Thanks @taylorlee! - fix: synchronize observability settings during wrangler versions deploy

    When running wrangler versions deploy, Wrangler will now update observability settings in addition to logpush and tail_consumers. Unlike wrangler deploy, it will not disable observability when observability is undefined in wrangler.toml.

  • #7080 924ec18 Thanks @vicb! - chore(wrangler): update unenv dependency version

  • #7097 8ca4b32 Thanks @emily-shen! - fix: remove deprecation warnings for wrangler init

    We will not be removing wrangler init (it just delegates to create-cloudflare now). These warnings were causing confusion for users as it wrangler init is still recommended in many places.

  • #7073 656a444 Thanks @penalosa! - Internal refactor to remove es-module-lexer and support wrangler types for Workers with Durable Objects & JSX

  • #7024 bd66d51 Thanks @xortive! - fix: make individual parameters work for wrangler hyperdrive create when not using HoA

    wrangler hyperdrive create individual parameters were not setting the database name correctly when calling the api.

  • #7024 bd66d51 Thanks @xortive! - refactor: use same param parsing code for wrangler hyperdrive create and wrangler hyperdrive update

    ensures that going forward, both commands support the same features and have the same names for config flags

3.83.0

Minor Changes

  • #7000 1de309b Thanks @jkoe-cf! - feature: allowing users to specify a description when creating an event notification rule

Patch Changes

  • #7011 cef32c8 Thanks @GregBrimble! - fix: Correctly apply Durable Object migrations for namespaced scripts

  • #7067 4aa35c5 Thanks @LuisDuarte1! - Change trigger command to comply with the current workflows endpoint.

    This also adds an id option to allow users to optionally customize the new instance id.

  • #7082 3f1d79c Thanks @LuisDuarte1! - Change to new terminate instance workflow endpoint

  • #7036 e7ea600 Thanks @penalosa! - Reduce KV bulk upload bucket size to 1000 (from the previous 5000)

  • #7068 a2afcf1 Thanks @RamIdeas! - log warning of Workflows open-beta status when running deploying a Worker that contains a Workflow binding

  • #7065 b219296 Thanks @penalosa! - Internal refactor to remove React/ink from all non-wrangler dev flows

  • #7064 a90980c Thanks @penalosa! - Fix wrangler dev --remote --show-interactive-dev-session=false by only enabling hotkeys after account selection if hotkeys were previously enabled

  • #7045 5ef6231 Thanks @RamIdeas! - Add preliminary support for Workflows in wrangler dev

  • #7075 80e5bc6 Thanks @LuisDuarte1! - Fix params serialization when send the trigger workflow API

    Previously, wrangler did not parse the params sending it as a string to workflow's services.

  • Updated dependencies [760e43f, 8dc2b7d, 5ef6231]:

3.82.0

Minor Changes

Patch Changes

  • #5737 9bf51d6 Thanks @penalosa! - Validate duplicate bindings across all binding types

  • #7010 1f6ff8b Thanks @vicb! - chore: update unenv dependency version

  • #7012 244aa57 Thanks @RamIdeas! - Add support for Workflow bindings (in deployments, not yet in local dev)

    To bind to a workflow, add a workflows section in your wrangler.toml:

    [[workflows]]
    binding = "WORKFLOW"
    name = "my-workflow"
    class_name = "MyDemoWorkflow"
    

    and export an entrypoint (e.g. MyDemoWorkflow) in your script:

    import { WorkflowEntrypoint } from "cloudflare:workers";
    
    export class MyDemoWorkflow extends WorkflowEntrypoint<Env, Params> {...}
    
  • #7039 e44f496 Thanks @penalosa! - Only show dev registry connection status in local dev

  • #7037 e1b93dc Thanks @emily-shen! - fix: ask for confirmation before creating a new Worker when uploading secrets

    Previously, wrangler secret put KEY --name non-existent-worker would automatically create a new Worker with the name non-existent-worker. This fix asks for confirmation before doing so (if running in an interactive context). Behaviour in non-interactive/CI contexts should be unchanged.

  • #7015 48152d6 Thanks @RamIdeas! - add wrangler workflows ... commands

  • #7041 045787b Thanks @CarmenPopoviciu! - Show wrangler pages dev --proxy warning

    On Node.js 17+, wrangler will default to fetching only the IPv6 address. With these changes we warn users that the process listening on the port specified via --proxy should be configured for IPv6.

  • #7018 127615a Thanks @emily-shen! - fix: log successful runs of d1 execute in local

  • #6970 a8ca700 Thanks @oliy! - Add HTTP authentication options for Workers Pipelines

  • #7005 6131ef5 Thanks @edmundhung! - fix: prevent users from passing multiple arguments to non array options

  • #7046 f9d5fdb Thanks @oliy! - Minor change to 3rd party API shape for Workers Pipelines

  • #6972 c794935 Thanks @penalosa! - Add (local) indicator to bindings using local data

  • Updated dependencies [809193e]:

3.81.0

Minor Changes

Patch Changes

  • #6963 a5ac45d Thanks @RamIdeas! - fix: make wrangler dev --remote respect wrangler.toml's account_id property.

    This was a regression in the --x-dev-env flow recently turned on by default.

  • #6996 b8ab809 Thanks @emily-shen! - fix: improve error messaging when accidentally using Workers commands in Pages project

    If we detect a Workers command used with a Pages project (i.e. wrangler.toml contains pages_output_build_dir), error with Pages version of command rather than "missing entry-point" etc.

3.80.5

Patch Changes

3.80.4

Patch Changes

3.80.3

Patch Changes

3.80.2

Patch Changes

  • #6923 1320f20 Thanks @andyjessop! - chore: adds eslint-disable for ESLint error on empty typescript interface in workers-configuration.d.ts

3.80.1

Patch Changes

  • #6908 d696850 Thanks @penalosa! - fix: debounce restarting worker on assets dir file changes when --x-dev-env is enabled.

  • #6902 dc92af2 Thanks @threepointone! - fix: enable esbuild's keepNames: true to set .name on functions/classes

  • #6909 82180a7 Thanks @penalosa! - fix: Various fixes for logging in --x-dev-env, primarily to ensure the hotkeys don't wipe useful output and are cleaned up correctly

  • #6903 54924a4 Thanks @petebacondarwin! - fix: ensure that alias config gets passed through to the bundler when using new --x-dev-env

    Fixes #6898

  • #6911 30b7328 Thanks @emily-shen! - fix: infer experimentalJsonConfig from file extension

    Fixes #5768 - issue with vitest and Pages projects with wrangler.toml

  • Updated dependencies [5c50949]:

3.80.0

Minor Changes

Patch Changes

  • #6854 04a8fed Thanks @penalosa! - chore: Include serialised FormData in debug logs

  • #6879 b27d8cb Thanks @petebacondarwin! - fix: the docs command should not crash if given search terms

    Fixes a regression accidentally introduced by #3735.

  • #6873 b123f43 Thanks @zwily! - fix: reduce logging noise during wrangler dev with static assets

    Updates to static assets are accessible by passing in --log-level="debug" but otherwise hidden.

  • #6881 7ca37bc Thanks @RamIdeas! - fix: custom builds outputting files in assets watched directory no longer cause the custom build to run again in an infinite loop

  • #6872 b2d094e Thanks @petebacondarwin! - fix: render a helpful build error if a Service Worker mode Worker has imports

    A common mistake is to forget to export from the entry-point of a Worker, which causes Wrangler to infer that we are in "Service Worker" mode.

    In this mode, imports to external modules are not allowed. Currently this only fails at runtime, because our esbuild step converts these imports to an internal __require() call that throws an error. The error message is misleading and does not help the user identify the cause of the problem. This is particularly tricky where the external imports are added by a library or our own node.js polyfills.

    Fixes #6648

  • #6792 27e8385 Thanks @penalosa! - fix: Handle more module declaration cases

  • #6838 7dbd0c8 Thanks @GregBrimble! - fix: Improve static asset upload messaging

3.79.0

Minor Changes

  • #6801 6009bb4 Thanks @RamIdeas! - feat: implement retries within wrangler deploy and wrangler versions upload to workaround spotty network connections and service flakes

Patch Changes

  • #6870 dc9039a Thanks @penalosa! - fix: Include workerd in the external dependecies of Wrangler to fix local builds.

  • #6866 c75b0d9 Thanks @zwily! - fix: debounce restarting worker on assets dir file changes

3.78.12

Patch Changes

  • #6840 5bfb75d Thanks @a-robinson! - chore: update warning in wrangler dev --remote when using Queues to not mention beta status

3.78.11

Patch Changes

3.78.10

Patch Changes

3.78.9

Patch Changes

3.78.8

Patch Changes

  • #6791 74d719f Thanks @penalosa! - fix: Add missing binding to init --from-dash

  • #6728 1ca313f Thanks @emily-shen! - fix: remove filepath encoding on asset upload and handle sometimes-encoded characters

    Some characters like [ ] @ are encoded by encodeURIComponent() but are often requested at an unencoded URL path. This change will make assets with filenames with these characters accessible at both the encoded and unencoded paths, but to use the encoded path as the canonical one, and to redirect requests to the canonical path if necessary.

  • #6798 7d7f19a Thanks @emily-shen! - fix: error if an asset binding is provided without a Worker script

  • Updated dependencies [1ca313f]:

3.78.7

Patch Changes

  • #6775 ecd82e8 Thanks @CarmenPopoviciu! - fix: Support switching between static and dynamic Workers

    This commit fixes the current behaviour of watch mode for Workers with assets, and adds support for switching between static and dynamic Workers within a single wrangler dev session.

  • #6762 2840b9f Thanks @petebacondarwin! - fix: error if a user inadvertently uploads a Pages _workers.js file or directory as an asset

  • #6778 61dd93a Thanks @CarmenPopoviciu! - fix: Error if Workers + Assets are run in remote mode

    Workers + Assets are currently supported only in local mode. We should throw an error if users attempt to use Workers with assets in remote mode.

  • #6782 7655505 Thanks @vicb! - chore: update unenv dependency version

  • #6777 9649dbc Thanks @penalosa! - chore: Update CI messaging

  • #6779 3e75612 Thanks @emily-shen! - fix: include asset binding in wrangler types

3.78.6

Patch Changes

  • #6743 b45e326 Thanks @petebacondarwin! - fix: ability to build tricky Node.js compat scenario Workers

    Adds support for non-default build conditions and platform via the WRANGLER_BUILD_CONDITIONS and WRANGLER_BUILD_PLATFORM flags.

    Fixes https://github.com/cloudflare/workers-sdk/issues/6742

  • #6776 02de103 Thanks @zebp! - fix: disable observability on deploy if not explicitly defined in config

    When deploying a Worker that has observability enabled in the deployed version but not specified in the wrangler.toml Wrangler will now set observability to disabled for the new version to match the wrangler.toml as the source of truth.

  • Updated dependencies [2ddbb65]:

3.78.5

Patch Changes

  • #6744 e3136f9 Thanks @petebacondarwin! - chore: update unenv dependency version

  • #6749 9a06f88 Thanks @CarmenPopoviciu! - fix: Throw error when attempting to configure Workers with assets and tail consumers

    Tail Workers are currently not supported for Workers with assets. This commit ensures we throw a corresponding error if users are attempting to configure tail_consumers via their configuration file, for a Worker with assets. This validation is applied for all wrangler dev, wrangler deploy, wrangler versions upload.

  • #6746 0deb42b Thanks @GregBrimble! - fix: Fix assets upload message to correctly report number of uploaded assets

  • #6745 6dbbb88 Thanks @jonesphillip! - fix: r2 bucket notification get <bucket_name> has been marked deprecated in favor of r2 bucket notification list <bucket_name> to reflect behavior.

  • Updated dependencies [2407c41]:

3.78.4

Patch Changes

  • #6706 1c42466 Thanks @jkoe-cf! - fix: making explicit to only send a body if there are rule ids specified in the config delete

  • #6714 62082aa Thanks @OilyLime! - fix: rough edges when creating and updating Hyperdrive over Access configs

  • #6705 ea60a52 Thanks @emily-shen! - fix: include compatibility date in static-asset only uploads (experimental feature)

3.78.3

Patch Changes

3.78.2

Patch Changes

3.78.1

Patch Changes

3.78.0

Minor Changes

  • #6643 f30c61f Thanks @WalshyDev! - feat: add "Deployment alias URL" to wrangler pages deploy if an alias is available for this deployment.

  • #6415 b27b741 Thanks @irvinebroque! - chore: Redirect wrangler generate [template name] and wrangler init to npm create cloudflare

  • #6647 d68e8c9 Thanks @joshthoward! - feat: Configure SQLite backed Durable Objects in local dev

  • #6696 0a9e90a Thanks @penalosa! - feat: Support WRANGLER_CI_MATCH_TAG environment variable.

    When set, this will ensure that wrangler deploy and wrangler versions upload only deploy to Workers which match the provided tag.

  • #6702 aa603ab Thanks @hhoughgg! - feat: Hide wrangler pipelines until release

Patch Changes

3.77.0

Minor Changes

  • #6674 831f892 Thanks @andyjessop! - feat: Added new pipelines bindings. This creates a new binding that allows sending events to the specified pipeline.

    Example:

    pipelines binding = "MY_PIPELINE" pipeline = "my-pipeline"

  • #6668 88c40be Thanks @zebp! - feature: add observability setting to wrangler.toml

    Adds the observability setting which provides your Worker with automatic persistent logs that can be searched, filtered, and queried directly from the Workers dashboard.

  • #6679 2174127 Thanks @jkoe-cf! - feat: adding option to specify a rule within the config to delete (if no rules are specified, all rules get deleted)

  • #6666 4107f57 Thanks @threepointone! - feat: support analytics engine in local/remote dev

    This adds "support" for analytics engine datasets for wrangler dev. Specifically, it simply mocks the AE bindings so that they exist while developing (and don't throw when accessed).

    This does NOT add support in Pages, though we very well could do so in a similar way in a followup.

  • #6640 8527675 Thanks @petebacondarwin! - feat: experimental workers assets can be ignored by adding a .assetsignore file

    This file can be added to the root of the assets directory that is to be uploaded alongside the Worker when using experimental_assets.

    The file follows the .gitignore syntax, and any matching paths will not be included in the upload.

  • #6652 648cfdd Thanks @bthwaites! - feat: Update R2 Get Event Notification response, display, and actions

  • #6625 8dcd456 Thanks @maxwellpeterson! - feature: Add support for placement hints

    Adds the hint field to smart placement configuration. When set, placement hints will be used to decide where smart-placement-enabled Workers are run.

  • #6631 59a0072 Thanks @emily-shen! - feat: Add config options 'html_handling' and 'not_found_handling' to experimental_asset field in wrangler.toml

Patch Changes

  • #6621 6523db2 Thanks @emily-shen! - fix: Validate routes in wrangler dev and wrangler deploy for Workers with assets

    We want wrangler to error if users are trying to deploy a Worker with assets, and routes with a path component.

    All Workers with assets must have either:

    • custom domain routes
    • pattern routes which have no path component (except for the wildcard splat) "some.domain.com/*"
  • #6687 7bbed63 Thanks @GregBrimble! - fix: Fix asset upload count messaging

  • #6628 33cc0ec Thanks @GregBrimble! - chore: Improves messaging when uploading assets

  • #6671 48eeff4 Thanks @jkoe-cf! - fix: Update R2 Create Event Notification response

  • #6618 67711c2 Thanks @GregBrimble! - fix: Switch to multipart/form-data upload format for Workers Assets

    This has proven to be much more reliable.

  • Updated dependencies [3f5b934, 59a0072]:

3.76.0

Minor Changes

  • #6126 18c105b Thanks @IRCody! - feature: Add 'cloudchamber curl' command

    Adds a cloudchamber curl command which allows easy access to arbitrary cloudchamber API endpoints.

  • #6649 46a91e7 Thanks @andyjessop! - feature: Integrate the Cloudflare Pipelines product into wrangler.

    Cloudflare Pipelines is a product that handles the ingest of event streams into R2. This feature integrates various forms of managing pipelines.

    Usage: wrangler pipelines create <pipeline>: Create a new pipeline wrangler pipelines list: List current pipelines wrangler pipelines show <pipeline>: Show a pipeline configuration wrangler pipelines update <pipeline>: Update a pipeline wrangler pipelines delete <pipeline>: Delete a pipeline

    Examples: wrangler pipelines create my-pipeline --r2 MY_BUCKET --access-key-id "my-key" --secret-access-key "my-secret" wrangler pipelines show my-pipeline wrangler pipelines delete my-pipline

Patch Changes

  • #6612 6471090 Thanks @dario-piotrowicz! - fix: Add hyperdrive binding support in getPlatformProxy

    example:

    # wrangler.toml
    [[hyperdrive]]
    binding = "MY_HYPERDRIVE"
    id = "000000000000000000000000000000000"
    localConnectionString = "postgres://user:pass@127.0.0.1:1234/db"
    
    // index.mjs
    
    import postgres from "postgres";
    import { getPlatformProxy } from "wrangler";
    
    const { env, dispose } = await getPlatformProxy();
    
    try {
      const sql = postgres(
        // Note: connectionString points to `postgres://user:pass@127.0.0.1:1234/db` not to the actual hyperdrive
        //       connection string, for more details see the explanation below
        env.MY_HYPERDRIVE.connectionString
      );
      const results = await sql`SELECT * FROM pg_tables`;
      await sql.end();
    } catch (e) {
      console.error(e);
    }
    
    await dispose();
    

    Note: the returned binding values are no-op/passthrough that can be used inside node.js, meaning that besides direct connections via the connect methods, all the other values point to the same db connection specified in the user configuration

  • #6620 ecdfabe Thanks @petebacondarwin! - fix: don't warn about node:async_hooks if nodejs_als is set

    Fixes #6011

  • Updated dependencies [5936282, 6471090]:

3.75.0

Minor Changes

  • #6603 a197460 Thanks @taylorlee! - feature: log version preview url when previews exist

    The version upload API returns a field indicating whether a preview exists for that version. If a preview exists and workers.dev is enabled, wrangler will now log the full URL on version upload.

    This does not impact wrangler deploy, which only prints the workers.dev route of the latest deployment.

  • #6550 8d1d464 Thanks @Pedr0Rocha! - feature: add RateLimit type generation to the ratelimit unsafe binding.

Patch Changes

  • #6615 21a09e0 Thanks @RamIdeas! - chore: avoid potential double-install of create-cloudflare

    When wrangler init delegates to C3, it did so via npm create cloudflare@2.5.0. C3's v2.5.0 was the first to include auto-update support to avoid npx's potentially stale cache. But this also guaranteed a double install for users who do not have 2.5.0 cached. Now, wrangler delegates via npm create cloudflare@^2.5.0 which should use the latest version cached on the user's system or install and use the latest v2.x.x.

  • #6603 a197460 Thanks @taylorlee! - chore: fix version upload log order

    Previously deploy prints: upload timings deploy timings current version id

    while version upload prints: worker version id upload timings

    This change makes version upload more similar to deploy by printing version id after upload, which also makes more sense, as version ID can only be known after upload has finished.

3.74.0

Minor Changes

Patch Changes

3.73.0

Minor Changes

  • #6571 a7e1bfe Thanks @penalosa! - feat: Add deployment http targets to wrangler deploy logs, and add url to pages deploy logs

  • #6497 3bd833c Thanks @WalshyDev! - chore: move wrangler versions ..., wrangler deployments ..., wrangler rollback and wrangler triggers ... out of experimental and open beta. These are now available to use without the --x-versions flag, you can continue to pass this however without issue to keep compatibility with all the usage today.

    A few of the commands had an output that wasn't guarded by --x-versions those have been updated to use the newer output, we have tried to keep compatibility where possible (for example: wrangler rollback will continue to output "Worker Version ID:" so users can continue to grab the ID). If you wish to use the old versions of the commands you can pass the --no-x-versions flag. Note, these will be removed in the future so please work on migrating.

  • #6586 72ea742 Thanks @penalosa! - feat: Inject a 404 response for browser requested favicon.ico files when loading the /__scheduled page for scheduled-only Workers

  • #6497 3bd833c Thanks @WalshyDev! - feat: update wrangler deploy to use the new versions and deployments API. This should have zero user-facing impact but sets up the most used command to deploy Workers to use the new recommended APIs and move away from the old ones. We will still call the old upload path where required (e.g. Durable Object migration or Service Worker format).

Patch Changes

3.72.3

Patch Changes

  • #6548 439e63a Thanks @garvit-gupta! - fix: Fix Vectorize getVectors, deleteVectors payload in Wrangler Client; VS-271

  • #6554 46aee5d Thanks @andyjessop! - fix: nodejs_compat flags no longer error when running wrangler types --x-include-runtime

  • #6548 439e63a Thanks @garvit-gupta! - fix: Add content-type header to Vectorize POST operations; #6516/VS-269

  • #6566 669ec1c Thanks @penalosa! - fix: Ensure esbuild warnings are logged when running wrangler deploy

  • Updated dependencies [6c057d1]:

    • @cloudflare/workers-shared@0.4.0

3.72.2

Patch Changes

3.72.1

Patch Changes

  • #6530 d0ecc6a Thanks @WalshyDev! - fix: fixed wrangler versions upload printing bindings twice

  • #6502 a9b4f25 Thanks @garvit-gupta! - fix: Fix Vectorize List MetadataIndex Http Method

  • #6508 56a3de2 Thanks @petebacondarwin! - fix: move the Windows C++ redistributable warning so it is only shown if there is an actual access violation

    Replaces #6471, which was too verbose.

    Fixes #6170

3.72.0

Minor Changes

  • #6479 3c24d84 Thanks @petebacondarwin! - feat: allow HTTPS custom certificate paths to be provided by a environment variables

    As well as providing paths to custom HTTPS certificate files, it is now possible to use WRANGLER_HTTPS_KEY_PATH and WRANGLER_HTTPS_CERT_PATH environment variables.

    Specifying the file paths at the command line overrides specifying in environment variables.

    Fixes #5997

Patch Changes

3.71.0

Minor Changes

  • #6464 da9106c Thanks @AnantharamanSI! - feat: rename --count to --limit in wrangler d1 insights

    This PR renames wrangler d1 insight's --count flag to --limit to improve clarity and conform to naming conventions.

    To avoid a breaking change, we have kept --count as an alias to --limit.

  • #6451 515de6a Thanks @danielrs! - feat: whoami shows membership information when available

  • #6463 dbc6782 Thanks @AnantharamanSI! - feat: add queryEfficiency to wrangler d1 insights output

  • #6252 a2a144c Thanks @garvit-gupta! - feat: Enable Wrangler to operate on Vectorize V2 indexes

Patch Changes

  • #6424 3402ab9 Thanks @RamIdeas! - fix: using a debugger sometimes disconnected with "Message is too large" error

3.70.0

Minor Changes

Patch Changes

3.69.1

Patch Changes

3.69.0

Minor Changes

  • #6392 c3e19b7 Thanks @taylorlee! - feat: log Worker startup time in the version upload command

  • #6370 8a3c6c0 Thanks @CarmenPopoviciu! - feat: Create very basic Asset Server Worker and plumb it into wrangler dev

    These changes do the ground work needed in order to add Assets support for Workers in wrangler dev. They implement the following:

    • it creates a new package called workers-shared that hosts the Asset Server Worker, and the Router Workerin the future
    • it scaffolds the Asset Server Worker in some very basic form, with basic configuration. Further behaviour implementation will follow in a subsequent PR
    • it does the ground work of plumbing ASW into Miniflare

Patch Changes

  • #6392 c3e19b7 Thanks @taylorlee! - fix: remove bundle size warning from Worker deploy commands

    Bundle size was a proxy for startup time. Now that we have startup time reported, focus on bundle size is less relevant.

3.68.0

Minor Changes

  • #6318 dc576c8 Thanks @danlapid! - feat: Add a log for worker startup time in wrangler deploy

  • #6097 64f34e8 Thanks @RamIdeas! - feat: implements the --experimental-dev-env (shorthand: --x-dev-env) flag for wrangler pages dev

Patch Changes

  • #6379 31aa15c Thanks @RamIdeas! - fix: clearer error message when trying to use Workers Sites or Legacy Assets with wrangler versions upload

  • #6367 7588800 Thanks @RamIdeas! - fix: implicitly cleanup (call stop()) in unstable_dev if the returned Promise rejected and the stop() function was not returned

  • #6330 cfbdede Thanks @RamIdeas! - fix: when the worker's request.url is overridden using the host or localUpstream, ensure port is overridden/cleared too

    When using --localUpstream=example.com, the request.url would incorrectly be "example.com:8787" but is now "example.com".

    This only applies to wrangler dev --x-dev-env and unstable_dev({ experimental: { devEnv: true } }).

  • #6365 13549c3 Thanks @WalshyDev! - fix: WASM modules meant that wrangler versions secret ... could not properly update the version. This has now been fixed.

  • Updated dependencies [a9021aa, 44ad2c7]:

3.67.1

Patch Changes

  • #6312 67c611a Thanks @emily-shen! - feat: add CLI flag and config key for experimental Workers + Assets

    This change adds a new experimental CLI flag (--experimental-assets) and configuration key (experimental_assets) for the new Workers + Assets work.

    The new flag and configuration key are for the time being "inactive", in the sense that no behaviour is attached to them yet. This will follow up in future work.

  • Updated dependencies [b3c3cb8]:

3.67.0

Minor Changes

  • #4545 e5afae0 Thanks @G4brym! - Remove experimental/beta constellation commands and binding, please migrate to Workers AI, learn more here https://developers.cloudflare.com/workers-ai/. This is not deemed a major version bump for Wrangler since these commands were never generally available.

  • #6322 373248e Thanks @IRCody! - Add cloudchamber scope to existing scopes instead of replacing them.

    When using any cloudchamber command the cloudchamber scope will now be added to the existing scopes instead of replacing them.

  • #6276 a432a13 Thanks @CarmenPopoviciu! - feat: Add support for wrangler.jsonc

    This commit adds support for wrangler.jsonc config file for Workers. This feature is available behind the --experimental-json-config flag (just like wrangler.json).

    To use the new configuration file, add a wrangler.jsonc file to your Worker project and run wrangler dev --experimental-json-config or wrangler deploy --experimental-json-config.

    Please note that this work does NOT add wrangler.json or wrangler.jsonc support for Pages projects!

  • #6168 1ee41ff Thanks @IRCody! - feature: Add list and remove subcommands to cloudchamber registries command.

Patch Changes

  • #6331 e6ada07 Thanks @threepointone! - fix: only warn about miniflare feature support (ai, vectorize, cron) once

    We have some warnings in local mode dev when trying to use ai bindings / vectorize / cron, but they are printed every time the worker is started. This PR changes the warning to only be printed once per worker start.

3.66.0

Minor Changes

  • #6295 ebc85c3 Thanks @andyjessop! - feat: introduce an experimental flag for wrangler types to dynamically generate runtime types according to the user's project configuration.

  • #6272 084d39e Thanks @emily-shen! - fix: add legacy-assets config and flag as alias of current assets behavior

    • The existing behavior of the assets config key/flag will change on August 15th.
    • legacy-assets will preserve current functionality.

Patch Changes

  • #6203 5462ead Thanks @geelen! - fix: Updating to match new D1 import/export API format

  • #6315 3fd94e7 Thanks @penalosa! - chore: Add RayID to wrangler login error message displayed when a user hits a bot challenge page

3.65.1

Patch Changes

3.65.0

Minor Changes

  • #6194 25afcb2 Thanks @zebp! - chore: Add duration and sourcemap size to upload metrics event

    Wrangler will now send the duration and the total size of any sourcemaps uploaded with your Worker to Cloudflare if you have metrics enabled.

  • #6259 eb201a3 Thanks @ottomated! - chore: Add types to DurableObjectNamespace type generation. For example:

    interface Env {
      OBJECT: DurableObjectNamespace<import("./src/index").MyDurableObject>;
    }
    
  • #6245 e4abed3 Thanks @OilyLime! - feature: Add support for Hyperdrive over Access configs

Patch Changes

  • #6255 d497e1e Thanks @rozenmd! - fix: teach wrangler init --from-dash about d1 bindings

    This PR teaches wrangler init --from-dash about D1 bindings, so they aren't incorrectly added to the wrangler.toml as unsafe bindings.

  • #6258 4f524f2 Thanks @dom96! - feature: Add warning about deploying Python with requirements.txt

    This expands on the warning shown for all Python Workers to include a message about deploying Python Workers with a requirements.txt not being supported.

  • #6249 8bbd824 Thanks @petebacondarwin! - chore: Update config-schema.json for the wrangler.toml

  • #5955 db11a0f Thanks @harugon! - fix: correctly escape newlines in constructType function for multiline strings

    This fix ensures that multiline strings are correctly handled by the constructType function. Newlines are now properly escaped to prevent invalid JavaScript code generation when using the wrangler types command. This improves robustness and prevents errors related to multiline string handling in environment variables and other configuration settings.

  • #6263 fa1016c Thanks @petebacondarwin! - fix: use cli script-name arg when deploying a worker with queue consumers

  • Updated dependencies [0d32448]:

3.64.0

Minor Changes

  • #4925 7d4a4d0 Thanks @dom96! - feature: whoami, logout and login commands mention the CLOUDFLARE_API_TOKEN env var now

    It is easy to get confused when trying to logout while the CLOUDFLARE_API_TOKEN env var is set. The logout command normally prints out a message which states that the user is not logged in. This change rectifes this to explicitly call out that the CLOUDFLARE_API_TOKEN is set and requests that the user unsets it to logout.

Patch Changes

  • #5032 75f7928 Thanks @dbenCF! - Adding client side error handling for R2 when the user tries to create a bucket with an invalid name. The purpose of this addition is to provide the user with more context when encountering this error.

  • #4398 4b1e5bc Thanks @mattpocock! - fix: update tsconfig for Workers generated by wrangler init

3.63.2

Patch Changes

  • #6199 88313e5 Thanks @dario-piotrowicz! - fix: make sure getPlatformProxy's ctx methods throw illegal invocation errors like workerd

    in workerd detaching the waitUntil and passThroughOnException methods from the ExecutionContext object results in them throwing illegal invocation errors, such as for example:

    export default {
      async fetch(_request, _env, { waitUntil }) {
        waitUntil(() => {}); // <-- throws an illegal invocation error
        return new Response("Hello World!");
      },
    };
    

    make sure that the same behavior is applied to the ctx object returned by getPlatformProxy

  • #5569 75ba960 Thanks @penalosa! - fix: Simplify wrangler pages download config:

    • Don't include inheritable keys in the production override if they're equal to production
    • Only create a preview environment if needed, otherwise put the preview config at the top level

3.63.1

Patch Changes

  • #6192 b879ce4 Thanks @petebacondarwin! - fix: do not report D1 user errors to Sentry

  • #6150 d993409 Thanks @CarmenPopoviciu! - fix: Fix pages dev watch mode [_worker.js]

    The watch mode in pages dev for Advanced Mode projects is currently partially broken, as it only watches for changes in the "_worker.js" file, but not for changes in any of its imported dependencies. This means that given the following "_worker.js" file

    import { graham } from "./graham-the-dog";
    export default {
    	fetch(request, env) {
    		return new Response(graham)
    	}
    }
    

    pages dev will reload for any changes in the _worker.js file itself, but not for any changes in graham-the-dog.js, which is its dependency.

    Similarly, pages dev will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports.

    This commit fixes all the aforementioned issues.

3.63.0

Minor Changes

  • #6167 e048958 Thanks @threepointone! - feature: alias modules in the worker

    Sometimes, users want to replace modules with other modules. This commonly happens inside a third party dependency itself. As an example, a user might have imported node-fetch, which will probably never work in workerd. You can use the alias config to replace any of these imports with a module of your choice.

    Let's say you make a fetch-nolyfill.js

    export default fetch; // all this does is export the standard fetch function`
    

    You can then configure wrangler.toml like so:

    # ...
    [alias]
    "node-fetch": "./fetch-nolyfill"
    

    So any calls to import fetch from 'node-fetch'; will simply use our nolyfilled version.

    You can also pass aliases in the cli (for both dev and deploy). Like:

    npx wrangler dev --alias node-fetch:./fetch-nolyfill
    
  • #6073 7ed675e Thanks @geelen! - Added D1 export support for local databases

Patch Changes

  • #6149 35689ea Thanks @RamIdeas! - refactor: React-free hotkeys implementation, behind the --x-dev-env flag

  • #6022 7951815 Thanks @CarmenPopoviciu! - fix: Fix pages dev watch mode [Functions]

    The watch mode in pages dev for Pages Functions projects is currently partially broken, as it only watches for file system changes in the "/functions" directory, but not for changes in any of the Functions' dependencies. This means that given a Pages Function math-is-fun.ts, defined as follows:

    import { ADD } from "../math/add";
    
    export async function onRequest() {
    	return new Response(`${ADD} is fun!`);
    }
    

    pages dev will reload for any changes in math-is-fun.ts itself, but not for any changes in math/add.ts, which is its dependency.

    Similarly, pages dev will not reload for any changes in non-JS module imports, such as wasm/html/binary module imports.

    This commit fixes all these things, plus adds some extra polish to the pages dev watch mode experience.

  • #6164 4cdad9b Thanks @threepointone! - fix: use account id for listing zones

    Fixes https://github.com/cloudflare/workers-sdk/issues/4944

    Trying to fetch /zones fails when it spans more than 500 zones. The fix to use an account id when doing so. This patch passes the account id to the zones call, threading it through all the functions that require it.

  • #6180 b994604 Thanks @Skye-31! - Fix: pass env to getBindings to support reading .dev.vars.{environment}

    https://github.com/cloudflare/workers-sdk/pull/5612 added support for selecting the environment of config used, but it missed passing it to the code that reads .dev.vars.{environment}

    Closes #5641

  • #6124 d03b102 Thanks @RamIdeas! - feat: url and inspectorUrl properties have been exposed on the worker object returned by new unstable_DevEnv().startWorker(options)

  • #6147 02dda3d Thanks @penalosa! - refactor: React free dev registry

  • #6127 1568c25 Thanks @DaniFoldi! - fix: Bump ws dependency

  • #6140 4072114 Thanks @petebacondarwin! - fix: add extra error logging to auth response errors

  • #6160 9466531 Thanks @sm-bean! - fix: removes unnecessary wrangler tail warning against resetting durable object

    fixes https://jira.cfdata.org/browse/STOR-3318

  • #6142 9272ef5 Thanks @dario-piotrowicz! - fix: improve the getPlatformProxy configPath option ts-doc comment to clarify its behavior

  • Updated dependencies [42a7930, 7ed675e, 1568c25]:

3.62.0

Minor Changes

  • #5950 0075621 Thanks @WalshyDev! - feat: add wrangler versions secret put, wrangler versions secret bulk and wrangler versions secret list

    wrangler versions secret put allows for you to add/update a secret even if the latest version is not fully deployed. A new version with this secret will be created, the existing secrets and config are copied from the latest version.

    wrangler versions secret bulk allows you to bulk add/update multiple secrets at once, this behaves the same as secret put and will only make one new version.

    wrangler versions secret list lists the secrets available to the currently deployed versions. wrangler versions secret list --latest-version or wrangler secret list will list for the latest version.

    Additionally, we will now prompt for extra confirmation if attempting to rollback to a version with different secrets than the currently deployed.

Patch Changes

  • #6118 1621992 Thanks @WalshyDev! - fix: rollback in the case of a secret change, the prompt meant to show was not showing due to the spinner in an interactive env. It will now properly show.

    chore: improve the view of wrangler versions view and change up copy a little for versions secret commands.

  • #6105 26855f3 Thanks @helloimalastair! - feat: Add help messages to all invalid r2 commands

  • #3735 9c7df38 Thanks @lrapoport-cf! - chore: Cleanup wrangler --help output

    This commit cleans up and standardizes the look and feel of all wrangler commands as displayed by wrangler --help and wrangler <cmd> --help.

  • #6080 e2972cf Thanks @threepointone! - chore: run eslint (with react config) on workers-playground/wrangler

    This enables eslint (with our react config) for the workers-playground project. Additionally, this enables the react-jsx condition in relevant tsconfig/eslint config, letting us write jsx without having React in scope.

  • #6001 d39d595 Thanks @penalosa! - chore: changes to how wrangler dev launches your worker, behind the experimental --x-dev-env flag

  • #5214 05c5607 Thanks @penalosa! - feat: Experimental file based service discovery when running multiple Wrangler instances locally. To try it out, make sure all your local Wrangler instances are running with the --x-registry flag.

  • Updated dependencies [7d02856, d4e1e9f]:

3.61.0

Minor Changes

  • #5995 374bc44 Thanks @petebacondarwin! - feat: allow Durable Object migrations to be overridable in environments

    By making the migrations key inheritable, users can provide different migrations for each wrangler.toml environment.

    Resolves #729

Patch Changes

  • #6039 dc597a3 Thanks @petebacondarwin! - fix: hybrid nodejs compat now supports requiring the default export of a CJS module

    Fixes #6028

  • #6051 15aff8f Thanks @threepointone! - fix: Don't check expiry dates on custom certs

    Fixes https://github.com/cloudflare/workers-sdk/issues/5964

    For wrangler dev, we don't have to check whether certificates have expired when they're provided by the user.

  • #6052 b4c0233 Thanks @threepointone! - chore: Add .wrangler and .DS_Store to .gitignore generated by wrangler init

    This commit adds a small QOL improvement to init (to be deprecated in the future), for those who still use this wrangler command.

  • #6050 a0c3327 Thanks @threepointone! - chore: Normalize more deps

    This is the last of the patches that normalize dependencies across the codebase. In this batch: ws, vitest, zod , rimraf, @types/rimraf, ava, source-map, glob, cookie, @types/cookie, @microsoft/api-extractor, @types/mime, @types/yargs, devtools-protocol, @vitest/ui, execa, strip-ansi

    This patch also sorts dependencies in every package.json

  • #6029 f5ad1d3 Thanks @threepointone! - chore: Normalize some dependencies in workers-sdk

    This is the first of a few expected patches that normalize dependency versions, This normalizes undici, concurrently, @types/node, react, react-dom, @types/react, @types/react-dom, eslint, typescript. There are no functional code changes (but there are a couple of typecheck fixes).

  • #6046 c643a81 Thanks @threepointone! - chore: Normalize more dependencies.

    Follow up to https://github.com/cloudflare/workers-sdk/pull/6029, this normalizes some more dependencies : get-port, chalk, yargs, toucan-js, @typescript-eslint/parser, @typescript-eslint/eslint-plugin, esbuild-register, hono, glob-to-regexp, @cloudflare/workers-types

  • #6058 31cd51f Thanks @threepointone! - chore: Quieter builds

    This patch cleans up warnings we were seeing when doing a full build. Specifically:

    • fixtures/remix-pages-app had a bunch of warnings about impending features that it should be upgraded to, so I did that. (tbh this one needs a full upgrade of packages, but we'll get to that later when we're upgrading across the codebase)
    • updated @microsoft/api-extractor so it didn't complain that it didn't match the typescript version (that we'd recently upgraded)
    • it also silenced a bunch of warnings when exporting types from wrangler. We'll need to fix those, but we'll do that when we work on unstable_dev etc.
    • workers-playground was complaining about the size of the bundle being generated, so I increased the limit on it
  • #6043 db66101 Thanks @threepointone! - fix: avoid esbuild warning when running dev/bundle

    I've been experimenting with esbuild 0.21.4 with wrangler. It's mostly been fine. But I get this warning every time

    ▲ [WARNING] Import "__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__" will always be undefined because there is no matching export in "src/index.ts" [import-is-undefined]
    
        .wrangler/tmp/bundle-Z3YXTd/middleware-insertion-facade.js:8:23:
          8 │ .....(OTHER_EXPORTS.__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__ ?? []),
            ╵
    

    This is because esbuild@0.18.5 enabled a warning by default whenever an undefined import is accessed on an imports object. However we abuse imports to inject stuff in middleware.test.ts. A simple fix is to only inject that code in tests.

  • #6062 267761b Thanks @WalshyDev! - fix: typo in wrangler d1 execute saying "Databas" instead of "Database"

  • #6064 84e6aeb Thanks @helloimalastair! - fix: Wrangler is now able to upload files to local R2 buckets above the 300 MiB limit

  • Updated dependencies [a0c3327, f5ad1d3, 31cd51f]:

3.60.3

Patch Changes

  • #6025 122ef06 Thanks @IgorMinar! - fix: avoid path collisions between performance and Performance Node.js polyfills

    It turns out that ESBuild paths are case insensitive, which can result in path collisions between polyfills for globalThis.performance and globalThis.Performance, etc.

    This change ensures that we encode all global names to lowercase and decode them appropriately.

  • #6009 169a9fa Thanks @RamIdeas! - fix: reduce the number of parallel file reads on Windows to avoid EMFILE type errors

    Fixes #1586

  • 53acdbc Thanks @petebacondarwin! - fix: warn if user tries normal deploy when in the middle of a gradual version rollout

  • Updated dependencies [c4146fc]:

3.60.2

Patch Changes

  • #5307 e6a3d24 Thanks @achanda! - fix: add more timePeriods to wrangler d1 insights

    This PR updates wrangler d1 insights to accept arbitrary timePeriod values up to 31 days.

3.60.1

Patch Changes

3.60.0 [DEPRECATED]

Minor Changes

  • #5878 1e68fe5 Thanks @IgorMinar! - feat: add experimental support for hybrid Node.js compatibility

    This feature is experimental and not yet available for general consumption.

    Use a combination of workerd Node.js builtins (behind the experimental:nodejs_compat_v2 flag) and Unenv polyfills (configured to only add those missing from the runtime) to provide a new more effective Node.js compatibility approach.

  • #5988 e144f63 Thanks @RamIdeas! - feature: rename the wrangler secret:bulk command to wrangler secret bulk

    The old command is now deprecated (but still functional) and will be removed in a future release. The new command is now more consistent with the rest of the wrangler CLI commands.

  • #5989 35b1a2f Thanks @RamIdeas! - feature: rename wrangler kv:... commands to wrangler kv ...

    The old commands are now deprecated (but still functional) and will be removed in a future release. The new commands are now more consistent with the rest of the wrangler CLI commands.

  • #5861 1cc52f1 Thanks @zebp! - feat: allow for Pages projects to upload sourcemaps

    Pages projects can now upload sourcemaps for server bundles to enable remapped stacktraces in realtime logs when deployed with upload_source_map set to true in wrangler.toml.

Patch Changes

  • #5939 21573f4 Thanks @penalosa! - refactor: Adds the experimental flag --x-dev-env which opts in to using an experimental code path for wrangler dev and wrangler dev --remote. There should be no observable behaviour changes when this flag is enabled.

  • #5934 bac79fb Thanks @dbenCF! - fix: Update create KV namespace binding details message for easier implementation

  • #5927 6f83641 Thanks @CarmenPopoviciu! - fix: Clean pages dev terminal ouput

    This work includes a series of improvements to the pages dev terminal output, in an attempt to make this output more structured, organised, cleaner, easier to follow, and therefore more helpful for our users <3

  • #5960 e648825 Thanks @petebacondarwin! - fix: avoid injecting esbuild watch stubs into production Worker code

    When we added the ability to include additional modules in the deployed bundle of a Worker, we inadvertently also included some boiler plate code that is only needed at development time.

    This fix ensures that this code is only injected if we are running esbuild in watch mode (e.g. wrangler dev) and not when building for deployment.

    It is interesting to note that this boilerplate only gets included in the production code if there is an import of CommonJS code in the Worker, which esbuild needs to convert to an ESM import.

    Fixes #4269

  • Updated dependencies [ab95473]:

3.59.0

Minor Changes

  • #5963 bf803d7 Thanks @Skye-31! - Feature: Add support for hiding the "unsafe" fields are experimental warning using an environment variable

    By setting WRANGLER_DISABLE_EXPERIMENTAL_WARNING to any truthy value, these warnings will be hidden.

Patch Changes

3.58.0

Minor Changes

  • #5933 93b98cb Thanks @WalshyDev! - feature: allow for writing authentication details per API environment. This allows someone targetting staging to have their staging auth details saved separately from production, this saves them logging in and out when switching environments.

Patch Changes

  • #5938 9e4d8bc Thanks @threepointone! - fix: let "assets" in wrangler.toml be a string

    The experimental "assets" field can be either a string or an object. However the type definition marks it only as an object. This is a problem because we use this to generate the json schema, which gets picked up by vscode's even better toml extension, and shows it to be an error when used with a string (even though it works fine). The fix is to simply change the type definition to add a string variant.

  • #5758 8e5e589 Thanks @Jackenmen! - fix: use correct type for AI binding instead of unknown

  • Updated dependencies [e0e7725]:

3.57.2

Patch Changes

3.57.1

Patch Changes

  • #5859 f2ceb3a Thanks @w-kuhn! - fix: queue consumer max_batch_timeout should accept a 0 value

  • #5862 441a05f Thanks @CarmenPopoviciu! - fix: wrangler pages deploy should fail if deployment was unsuccessful

    If a Pages project fails to deploy, wrangler pages deploy will log an error message, but exit successfully. It should instead throw a FatalError.

  • #5812 d5e00e4 Thanks @thomasgauvin! - fix: remove Hyperdrive warning for local development.

    Hyperdrive bindings are now supported when developing locally with Hyperdrive. We should update our logs to reflect this.

  • #5626 a12b031 Thanks @RamIdeas! - chore: ignore workerd output (error: CODE_MOVED) not intended for end-user devs

3.57.0

Minor Changes

  • #5696 7e97ba8 Thanks @geelen! - feature: Improved d1 execute --file --remote performance & added support for much larger SQL files within a single transaction.

  • #5819 63f7acb Thanks @CarmenPopoviciu! - fix: Show feedback on Pages project deployment failure

    Today, if uploading a Pages Function, or deploying a Pages project fails for whatever reason, theres no feedback shown to the user. Worse yet, the shown message is misleading, saying the deployment was successful, when in fact it was not:

    ✨ Deployment complete!
    

    This commit ensures that we provide users with:

    • the correct feedback with respect to their Pages deployment
    • the appropriate messaging depending on the status of their project's deployment status
    • the appropriate logs in case of a deployment failure
  • #5814 2869e03 Thanks @CarmenPopoviciu! - fix: Display correct global flags in wrangler pages --help

    Running wrangler pages --help will list, amongst others, the following global flags:

    -j, --experimental-json-config
    -c, --config
    -e, --env
    -h, --help
    -v, --version
    

    This is not accurate, since flags such as --config, --experimental-json-config, or env are not supported by Pages.

    This commit ensures we display the correct global flags that apply to Pages.

  • #5818 df2daf2 Thanks @WalshyDev! - chore: Deprecate usage of the deployment object on the unsafe metadata binding in favor of the new version_metadata binding.

    If you're currently using the old binding, please move over to the new version_metadata binding by adding:

    [version_metadata]
    binding = "CF_VERSION_METADATA"
    

    and updating your usage accordingly. You can find the docs for the new binding here: https://developers.cloudflare.com/workers/runtime-apis/bindings/version-metadata

Patch Changes

  • #5838 609debd Thanks @petebacondarwin! - fix: update undici to the latest version to avoid a potential vulnerability

  • #5832 86a6e09 Thanks @petebacondarwin! - fix: do not allow non-string values in bulk secret uploads

    Prior to Wrangler 3.4.0 we displayed an error if the user tried to upload a JSON file that contained non-string secrets, since these are not supported by the Cloudflare backend.

    This change reintroduces that check to give the user a helpful error message rather than a cryptic workers.api.error.invalid_script_config error code.

3.56.0

Minor Changes

  • #5712 151bc3d Thanks @penalosa! - feat: Support mtls_certificates and browser bindings when using wrangler.toml with a Pages project

Patch Changes

  • #5813 9627cef Thanks @GregBrimble! - fix: Upload Pages project assets with more grace

    • Reduces the maximum bucket size from 50 MiB to 40 MiB.
    • Reduces the maximum asset count from 5000 to 2000.
    • Allows for more retries (with increased sleep between attempts) when encountering an API gateway failure.
  • Updated dependencies [0725f6f, 89b6d7f]:

3.55.0

Minor Changes

  • #5570 66bdad0 Thanks @sesteves! - feature: support delayed delivery in the miniflare's queue simulator.

    This change updates the miniflare's queue broker to support delayed delivery of messages, both when sending the message from a producer and when retrying the message from a consumer.

Patch Changes

  • #5740 97741db Thanks @WalshyDev! - chore: log "Version ID" in wrangler deploy, wrangler deployments list, wrangler deployments view and wrangler rollback to support migration from the deprecated "Deployment ID". Users should update any parsing to use "Version ID" before "Deployment ID" is removed.

  • #5754 f673c66 Thanks @RamIdeas! - fix: when using custom builds, the wrangler dev proxy server was sometimes left in a paused state

    This could be observed as the browser loading indefinitely, after saving a source file (unchanged) when using custom builds. This is now fixed by ensuring the proxy server is unpaused after a short timeout period.

  • Updated dependencies [66bdad0, 9b4af8a]:

3.54.0

Minor Changes

3.53.1

Patch Changes

  • #5091 6365c90 Thanks @Cherry! - fix: better handle dashes and other invalid JS identifier characters in wrangler types generation for vars, bindings, etc.

    Previously, with the following in your wrangler.toml, an invalid types file would be generated:

    [vars]
    some-var = "foobar"
    

    Now, the generated types file will be valid:

    interface Env {
      "some-var": "foobar";
    }
    
  • #5748 27966a4 Thanks @penalosa! - fix: Load sourcemaps relative to the entry directory, not cwd.

  • #5746 1dd9f7e Thanks @petebacondarwin! - fix: suggest trying to update Wrangler if there is a newer one available after an unexpected error

  • #5226 f63e7a5 Thanks @DaniFoldi! - fix: remove second Wrangler banner from wrangler dispatch-namespace rename

3.53.0

Minor Changes

  • #5604 327a456 Thanks @dario-piotrowicz! - feat: add support for environments in getPlatformProxy

    allow getPlatformProxy to target environments by allowing users to specify an environment option

    Example usage:

    const { env } = await getPlatformProxy({
      environment: "production",
    });
    

Patch Changes

3.52.0

Minor Changes

  • #5666 81d9615 Thanks @CarmenPopoviciu! - fix: Fix Pages config validation around Durable Objects

    Today Pages cannot deploy Durable Objects itself. For this reason it is mandatory that when declaring Durable Objects bindings in the config file, the script_name is specified. We are currently not failing validation if script_name is not specified but we should. These changes fix that.

Patch Changes

3.51.2

Patch Changes

3.51.1

Patch Changes

  • #5640 bd2031b Thanks @petebacondarwin! - fix: display user-friendly message when Pages function route param names are invalid.

    Param names can only contain alphanumeric and underscore characters. Previously the user would see a confusing error message similar to:

     TypeError: Unexpected MODIFIER at 8, expected END
    

    Now the user is given an error similar to:

    Invalid Pages function route parameter - "[hyphen-not-allowed]". Parameter names must only contain alphanumeric and underscore characters.
    

    Fixes #5540

  • #5619 6fe0af4 Thanks @gmemstr! - fix: correctly handle non-text based files for kv put

    The current version of the kv:key put command with the --path argument will treat file contents as a string because it is not one of Blob or File when passed to the form helper library. We should turn it into a Blob so it's not mangling inputs.

3.51.0

Minor Changes

  • #5477 9a46e03 Thanks @pmiguel! - feature: Changed Queues client to use the new QueueId and ConsumerId-based endpoints.

  • #5172 fbe1c9c Thanks @GregBrimble! - feat: Allow marking external modules (with --external) to avoid bundling them when building Pages Functions

    It's useful for Pages Plugins which want to declare a peer dependency.

Patch Changes

3.50.0

Minor Changes

  • #5587 d95450f Thanks @CarmenPopoviciu! - fix: pages functions build-env should throw error if invalid Pages config file is found

  • #5572 65aa21c Thanks @CarmenPopoviciu! - fix: fix pages function build-env to exit with code rather than throw fatal error

    Currently pages functions build-env throws a fatal error if a config file does not exit, or if it is invalid. This causes issues for the CI system. We should instead exit with a specific code, if any of those situations arises.

  • #5291 ce00a44 Thanks @pmiguel! - feature: Added bespoke OAuth scope for Queues management.

Patch Changes

3.49.0

Minor Changes

  • #5549 113ac41 Thanks @penalosa! - feat: Support wrangler pages secret put|delete|list|bulk

  • #5550 4f47f74 Thanks @penalosa! - feat: Generate a JSON schema for the Wrangler package & use it in templates

  • #5561 59591cd Thanks @ocsfrank! - feat: update R2 CreateBucket action to include the storage class in the request body

Patch Changes

  • #5374 7999dd2 Thanks @maxwellpeterson! - fix: Improvements to --init-from-dash

    Adds user-specified CPU limit to wrangler.toml if one exists. Excludes usage_model from wrangler.toml in all cases, since this field is deprecated and no longer used.

  • #5553 dcd65dd Thanks @rozenmd! - fix: refactor d1's time-travel compatibility check

  • #5380 57d5658 Thanks @GregBrimble! - fix: Respect --no-bundle when deploying a _worker.js/ directory in Pages projects

  • #5536 a7aa28a Thanks @Cherry! - fix: resolve a regression where wrangler pages dev would bind to port 8787 by default instead of 8788 since wrangler@3.38.0

  • Updated dependencies [9575a51]:

3.48.0

Minor Changes

  • #5429 c5561b7 Thanks @ocsfrank! - R2 will introduce storage classes soon. Wrangler allows you to interact with storage classes once it is enabled on your account.

    Wrangler supports an -s flag that allows the user to specify a storage class when creating a bucket, changing the default storage class of a bucket, and uploading an object.

    wrangler r2 bucket create ia-bucket -s InfrequentAccess
    wrangler r2 bucket update storage-class my-bucket -s InfrequentAccess
    wrangler r2 object put bucket/ia-object -s InfrequentAccess --file foo
    

Patch Changes

3.47.1

Patch Changes

3.47.0

Minor Changes

  • #5506 7734f80 Thanks @penalosa! - feat: Add interactive prompt to wrangler pages download config if an existing wrangler.toml file exists

3.46.0

Minor Changes

  • #5282 b7ddde1 Thanks @maxwellpeterson! - feature: Add source map support for Workers

    Adds the source_maps boolean config option. When enabled, source maps included in the build output are uploaded alongside the built code modules. Uploaded source maps can then be used to remap stack traces emitted by the Workers runtime.

  • #5215 cd03d1d Thanks @GregBrimble! - feature: support named entrypoints in service bindings

    This change allows service bindings to bind to a named export of another Worker. As an example, consider the following Worker named bound:

    import { WorkerEntrypoint } from "cloudflare:workers";
    
    export class EntrypointA extends WorkerEntrypoint {
      fetch(request) {
        return new Response("Hello from entrypoint A!");
      }
    }
    
    export const entrypointB: ExportedHandler = {
      fetch(request, env, ctx) {
        return new Response("Hello from entrypoint B!");
      },
    };
    
    export default <ExportedHandler>{
      fetch(request, env, ctx) {
        return new Response("Hello from the default entrypoint!");
      },
    };
    

    Up until now, you could only bind to the default entrypoint. With this change, you can bind to EntrypointA or entrypointB too using the new entrypoint option:

    [[services]]
    binding = "SERVICE"
    service = "bound"
    entrypoint = "EntrypointA"
    

    To bind to named entrypoints with wrangler pages dev, use the # character:

    $ wrangler pages dev --service=SERVICE=bound#EntrypointA
    

Patch Changes

  • #5215 cd03d1d Thanks @GregBrimble! - fix: ensure request url and cf properties preserved across service bindings

    Previously, Wrangler could rewrite url and cf properties when sending requests via service bindings or Durable Object stubs. To match production behaviour, this change ensures these properties are preserved.

  • Updated dependencies [cd03d1d, 6c3be5b, cd03d1d, cd03d1d]:

3.45.0

Minor Changes

  • #5377 5d68744 Thanks @CarmenPopoviciu! - feat: Add wrangler.toml support in wrangler pages deploy

    As we are adding wrangler.toml support for Pages, we want to ensure that wrangler pages deploy works with a configuration file.

  • #5471 489b9c5 Thanks @zebp! - feature: Add version-id filter for Worker tailing to filter logs by scriptVersion in a gradual deployment

    This allows users to only get logs in a gradual deployment if you are troubleshooting issues specific to one deployment. Example: npx wrangler tail --version-id 72d3f357-4e52-47c5-8805-90be978c403f

Patch Changes

3.44.0

Minor Changes

  • #5461 f69e562 Thanks @mattdeboard! - feature: Add command for fetching R2 Event Notification configurations for a given bucket

    This allows users to see the entire event notification configuration -- i.e. every rule for every configured queue -- for a single bucket with a single request.

    This change also improves messaging of console output when creating a new bucket notification.

Patch Changes

  • #5480 0cce21f Thanks @penalosa! - fix: Ensure url & node:url export URL (aliased to globalThis.URL) in node_compat mode

  • #5472 02a1091 Thanks @penalosa! - fix: Expose more info from wrangler pages functions build-env

3.43.0

Minor Changes

Patch Changes

3.42.0

Minor Changes

  • #5371 77152f3 Thanks @G4brym! - feature: remove requirement for @cloudflare/ai package to use Workers AI

    Previously, to get the correct Workers AI API, you needed to wrap your env.AI binding with new Ai() from @cloudflare/ai. This change moves the contents of @cloudflare/ai into the Workers runtime itself, meaning env.AI is now an instance of Ai, without the need for wrapping.

Patch Changes

3.41.0

Minor Changes

3.40.0

Minor Changes

  • #5426 9343714 Thanks @RamIdeas! - feature: added a new wrangler triggers deploy command

    This command currently requires the --experimental-versions flag.

    This command extracts the trigger deployment logic from wrangler deploy and allows users to update their currently deployed Worker's triggers without doing another deployment. This is primarily useful for users of wrangler versions upload and wrangler versions deploy who can then run wrangler triggers deploy to apply trigger changes to their currently deployed Worker Versions.

    The command can also be used even if not using the wrangler versions ... commands. And, in fact, users are already using it implicitly when running wrangler deploy.

  • #4932 dc0c1dc Thanks @xortive! - feature: Add support for private networking in Hyperdrive configs

  • #5369 7115568 Thanks @mattdeboard! - fix: Use queue name, not ID, for r2 bucket event-notification subcommands

    Since the original command was not yet operational, this update does not constitute a breaking change.

    Instead of providing the queue ID as the parameter to --queue, users must provide the queue name. Under the hood, we will query the Queues API for the queue ID given the queue name.

  • #5413 976adec Thanks @pmiguel! - feature: Added Queue delivery controls support in wrangler.toml

  • #5412 3e5a932 Thanks @RamIdeas! - feature: adds the --json option to wrangler deployments list --experimental-versions, wrangler deployments status --experimental-versions, wrangler versions list --experimental-versions and wrangler versions view --experimental-versions which will format the output as clean JSON. The --experimental-versions flag is still required for these commands.

  • #5258 fbdca7d Thanks @OilyLime! - feature: URL decode components of the Hyperdrive config connection string

  • #5416 47b325a Thanks @mattdeboard! - fix: minor improvements to R2 notification subcommand

    1. r2 bucket event-notification <subcommand> becomes r2 bucket notification <subcommand>
    2. Parameters to --event-type use - instead of _ (e.g. object_create -> object-create)

    Since the original command was not yet operational, this update does not constitute a breaking change.

Patch Changes

  • #5419 daac6a2 Thanks @RamIdeas! - chore: add helpful logging to --experimental-versions commands

  • #5400 c90dd6b Thanks @RamIdeas! - chore: log of impending change of "Deployment ID" to "Version ID" in wrangler deploy, wrangler deployments list, wrangler deployments view and wrangler rollback. This is a warning of a future change for anyone depending on the output text format, for example by grepping the output in automated flows.

  • #5422 b341614 Thanks @geelen! - fix: remove d1BetaWarning and all usages

    This PR removes the warning that D1 is in beta for all D1 commands.

  • Updated dependencies [fbdca7d]:

3.39.0

Minor Changes

  • #5373 5bd8db8 Thanks @RamIdeas! - feature: Implement versioned rollbacks via wrangler rollback [version-id] --experimental-versions.

    Please note, the experimental-versions flag is required to use the new behaviour. The original wrangler rollback command is unchanged if run without this flag.

Patch Changes

  • #5366 e11e169 Thanks @RamIdeas! - fix: save non-versioned script-settings (logpush, tail_consumers) on wrangler versions deploy. This command still requires --experimental-versions.

  • #5405 7c701bf Thanks @RamIdeas! - chore: add wrangler deployments view [deployment-id] --experimental-versions command

    This command will display an error message which points the user to run either wrangler deployments status --experimental-versions or wrangler versions view <version-id> --experimental-versions instead.

3.38.0

Minor Changes

  • #5310 528c011 Thanks @penalosa! - feat: Watch the entire module root for changes in --no-bundle mode, rather than just the entrypoint file.

  • #5327 7d160c7 Thanks @penalosa! - feat: Add wrangler pages download config

  • #5284 f5e2367 Thanks @CarmenPopoviciu! - feat: Add wrangler.toml support in wrangler pages dev

    As we are adding wrangler.toml support for Pages, we want to ensure that wrangler pages dev works with a configuration file.

  • #5353 3be826f Thanks @penalosa! - feat: Updates wrangler pages functions build to support using configuration from wrangler.toml in the generated output.

  • #5102 ba52208 Thanks @pmiguel! - feature: add support for queue delivery controls on wrangler queues create

Patch Changes

  • #5327 7d160c7 Thanks @penalosa! - fix: Use specific error code to signal a wrangler.toml file not being found in build-env

  • #5310 528c011 Thanks @penalosa! - fix: Reload Python workers when the requirements.txt file changes

3.37.0

Minor Changes

  • #5294 bdc121d Thanks @mattdeboard! - feature: Add event-notification commands in support of event notifications for Cloudflare R2.

    Included are commands for creating and deleting event notification configurations for individual buckets.

  • #5231 e88ad44 Thanks @w-kuhn! - feature: Add support for configuring HTTP Pull consumers for Queues

    HTTP Pull consumers can be used to pull messages from queues via https request.

Patch Changes

  • #5317 9fd7eba Thanks @GregBrimble! - chore: Deprecate -- <command>, --proxy and --script-path options from wrangler pages dev.

    Build your application to a directory and run the wrangler pages dev <directory> instead. This results in a more faithful emulation of production behavior.

  • Updated dependencies [248a318]:

3.36.0

Minor Changes

  • #5234 e739b7f Thanks @CarmenPopoviciu! - feat: Implement environment inheritance for Pages configuration

    For Pages, Wrangler will not require both of the supported named environments ("preview" | "production") to be explicitly defined in the config file. If either [env.production] or [env.preview] is left unspecified, Wrangler will use the top-level environment when targeting that named Pages environment.

Patch Changes

  • #5306 c60fed0 Thanks @taylorlee! - fix: Remove triggered_by annotation from experimental versions deploy command which is now set by the API and cannot be set by the client.

  • #5321 ac93411 Thanks @RamIdeas! - fix: rename --experimental-gradual-rollouts to --experimental-versions flag

    The --experimental-gradual-rollouts flag has been made an alias and will still work.

    And additional shorthand alias --x-versions has also been added and will work too.

  • #5324 bfc4282 Thanks @penalosa! - fix: Ignore OPTIONS requests in Wrangler's oauth server

    In Chrome v123, the auth requests from the browser back to wrangler now first include a CORS OPTIONS preflight request before the expected GET request. Wrangler was able to successfully complete the login with the first (OPTIONS) request, and therefore upon the second (GET) request, errored because the token exchange had already occured and could not be repeated.

    Wrangler now stops processing the OPTIONS request before completing the token exchange and only proceeds on the expected GET request.

    If you see a ErrorInvalidGrant in a previous wrangler version when running wrangler login, please try upgrading to this version or later.

  • #5099 93150aa Thanks @KaiSpencer! - feat: expose --show-interactive-dev-session flag

    This flag controls the interactive mode of the dev session, a feature that already exists internally but was not exposed to the user. This is useful for CI/CD environments where the interactive mode is not desired, or running in tools like turbo and nx.

3.35.0

Minor Changes

  • #5166 133a190 Thanks @CarmenPopoviciu! - feat: Implement config file validation for Pages projects

    Wrangler proper has a mechanism in place through which it validates a wrangler.toml file for Workers projects. As part of adding wrangler toml support for Pages, we need to put a similar mechanism in place, to validate a configuration file against Pages specific requirements.

  • #5279 0a86050 Thanks @penalosa! - feat: Support the hidden command wrangler pages functions build-env

  • #5093 a676f55 Thanks @benycodes! - feature: add --dispatch-namespace to wrangler deploy to support uploading Workers directly to a Workers for Platforms dispatch namespace.

Patch Changes

  • #5275 e1f2576 Thanks @petebacondarwin! - fix: ensure tail exits when the WebSocket disconnects

    Previously when the tail WebSocket disconnected, e.g. because of an Internet failure, the wrangler tail command would just hang and neither exit nor any longer receive tail messages.

    Now the process exits with an exit code of 1, and outputs an error message.

    The error message is formatted appropriately, if the tail format is set to json.

    Fixes #3927

  • #5069 8f79981 Thanks @RamIdeas! - chore: deprecate wrangler version command

    wrangler version is an undocumented alias for wrangler --version. It is being deprecated in favour of the more conventional flag syntax to avoid confusion with a new (upcoming) wrangler versions command.

  • Updated dependencies [1720f0a]:

3.34.2

Patch Changes

  • #5238 a0768bc Thanks @RamIdeas! - fix: versions upload annotations (--message and/or --tag) are now applied correctly to the uploaded Worker Version

3.34.1

Patch Changes

3.34.0

Minor Changes

  • #5224 03484c2 Thanks @RamIdeas! - feature: Implement wrangler deployments list and wrangler deployments status behind --experimental-gradual-rollouts flag.

  • #5115 29e8151 Thanks @RamIdeas! - feature: Implement wrangler versions deploy command.

    For now, invocations should use the --experimental-gradual-rollouts flag.

    Without args, a user will be guided through prompts. If args are specified, they are used as the default values for the prompts. If the --yes flag is specified, the defaults are automatically accepted for a non-interactive flow.

  • #5208 4730b6c Thanks @RamIdeas! - feature: Implement wrangler versions list and wrangler versions view commands behind the --experimental-gradual-rollouts flag.

  • #5064 bd935cf Thanks @OilyLime! - feature: Improve create and update logic for hyperdrive to include caching settings

3.33.0

Minor Changes

  • #4930 2680462 Thanks @rozenmd! - refactor: default wrangler d1 execute and wrangler d1 migrations commands to local mode first, to match wrangler dev

    This PR defaults wrangler d1 execute and wrangler d1 migrations commands to use the local development environment provided by wrangler to match the default behaviour in wrangler dev.

    BREAKING CHANGE (for a beta feature): wrangler d1 execute and wrangler d1 migrations commands now default --local to true. When running wrangler d1 execute against a remote D1 database, you will need to provide the --remote flag.

Patch Changes

3.32.0

Minor Changes

Patch Changes

  • #5089 5b85dc9 Thanks @DaniFoldi! - fix: include all currently existing bindings in wrangler types

    Add support for Email Send, Vectorize, Hyperdrive, mTLS, Browser Rendering and Workers AI bindings in wrangler types

    For example, from the following wrangler.toml setup:

    [browser]
    binding = "BROWSER"
    
    [ai]
    binding = "AI"
    
    [[send_email]]
    name = "SEND_EMAIL"
    
    [[vectorize]]
    binding = "VECTORIZE"
    index_name = "VECTORIZE_NAME"
    
    [[hyperdrive]]
    binding = "HYPERDRIVE"
    id = "HYPERDRIVE_ID"
    
    [[mtls_certificates]]
    binding = "MTLS"
    certificate_id = "MTLS_CERTIFICATE_ID"
    

    Previously, nothing would have been included in the generated Environment. Now, the following will be generated:

    interface Env {
      SEND_EMAIL: SendEmail;
      VECTORIZE: VectorizeIndex;
      HYPERDRIVE: Hyperdrive;
      MTLS: Fetcher;
      BROWSER: Fetcher;
      AI: Fetcher;
    }
    
  • Updated dependencies [11951f3, 11951f3]:

3.31.0

Minor Changes

Patch Changes

  • #5132 82a3f94 Thanks @mrbbot! - fix: switch default logging level of unstable_dev() to warn

    When running unstable_dev() in its default "test mode", the logging level was set to none. This meant any Worker startup errors or helpful warnings wouldn't be shown. This change switches the default to warn. To restore the previous behaviour, include logLevel: "none" in your options object:

    const worker = await unstable_dev("path/to/script.js", {
      logLevel: "none",
    });
    
  • #5128 d27e2a7 Thanks @taylorlee! - fix: Add legacy_env support to experimental versions upload command.

  • #5087 a5231de Thanks @dario-piotrowicz! - fix: make wrangler types always generate a d.ts file for module workers

    Currently if a config file doesn't define any binding nor module, running wrangler types against such file would not produce a d.ts file.

    Producing a d.ts file can however still be beneficial as it would define a correct env interface (even if empty) that can be expanded/referenced by user code (this can be particularly convenient for scaffolding tools that may want to always generate an env interface).

    Example: Before wrangler types --env-interface MyEnv run with an empty wrangler.toml file would not generate any file, after these change it would instead generate a file with the following content:

    interface MyEnv {
    }
    
  • #5138 3dd9089 Thanks @G4brym! - fix: ensure Workers-AI local mode fetcher returns headers to client worker

  • Updated dependencies [42bcc72, 42bcc72]:

3.30.1

Patch Changes

  • #5106 2ed7f32 Thanks @RamIdeas! - fix: automatically drain incoming request bodies

    Previously, requests sent to wrangler dev with unconsumed bodies could result in Network connection lost errors. This change attempts to work around the issue by ensuring incoming request bodies are drained if they're not used. This is a temporary fix whilst we try to address the underlying issue. Whilst we don't think this change will introduce any other issues, it can be disabled by setting the WRANGLER_DISABLE_REQUEST_BODY_DRAINING=true environment variable. Note this fix is only applied if you've enabled Wrangler's bundling—--no-bundle mode continues to have the previous behaviour.

  • #5107 65d0399 Thanks @penalosa! - fix: Ensures that switching to remote mode during a dev session (from local mode) will correctly use the right zone. Previously, zone detection happened before the dev session was mounted, and so dev sessions started with local mode would have no zone inferred, and would have failed to start, with an ugly error.

  • #5107 65d0399 Thanks @penalosa! - fix: Ensure that preview sessions created without a zone don't switch the host on which to start the preview from the one returned by the API.

  • #4833 54f6bfc Thanks @admah! - fix: remove extra arguments from wrangler init deprecation message and update recommended c3 version

    c3 can now infer the pre-existing type from the presence of the --existing-script flag so we can remove the extra type argument. C3 2.5.0 introduces an auto-update feature that will make sure users get the latest minor version of c3 and prevent problems where older 2.x.x versions get cached by previous runs of wrangler init.

3.30.0

Minor Changes

  • #4742 c2f3f1e Thanks @benycodes! - feat: allow preserving file names when defining rules for non-js modules

    The developer is now able to specify the `preserve_file_names property in wrangler.toml which specifies whether Wrangler will preserve the file names additional modules that are added to the deployment bundle of a Worker.

    If not set to true, files will be named using the pattern ${fileHash}-${basename}. For example, 34de60b44167af5c5a709e62a4e20c4f18c9e3b6-favicon.ico.

    Resolves #4741

Patch Changes

3.29.0

Minor Changes

  • #5042 5693d076 Thanks @dario-piotrowicz! - feat: add new --env-interface to wrangler types

    Allow users to specify the name of the interface that they want wrangler types to generate for the env parameter, via the new CLI flag --env-interface

    Example:

    wrangler types --env-interface CloudflareEnv
    

    generates

    interface CloudflareEnv {}
    

    instead of

    interface Env {}
    
  • #5042 5693d076 Thanks @dario-piotrowicz! - feat: add new path positional argument to wrangler types

    Allow users to specify the path to the typings (.d.ts) file they want wrangler types to generate

    Example:

    wrangler types ./my-env.d.ts
    

    generates a my-env.d.ts file in the current directory instead of creating a worker-configuration.d.ts file

Patch Changes

  • #5042 5693d076 Thanks @dario-piotrowicz! - feat: include command run in the wrangler types comment

    In the comment added to the .d.ts file generated by wrangler types include the command run to generated the file

  • #5042 5693d076 Thanks @dario-piotrowicz! - fix: make wrangler types honor top level config argument

    The wrangler types command currently ignores the -c|--config argument (although it is still getting shown in the command's help message). Make sure that the command honors the flag. Also, if no config file is detected present a warning to the user

  • #5042 5693d076 Thanks @dario-piotrowicz! - fix: make the wrangler types command pick up local secret keys from .dev.vars

    Make sure that the wrangler types command correctly picks up secret keys defined in .dev.vars and includes them in the generated file (marking them as generic string types of course)

  • Updated dependencies [b03db864]:

3.28.4

Patch Changes

  • #5050 88be4b84 Thanks @nora-soderlund! - fix: allow kv:namespace create to accept a namespace name that contains characters not allowed in a binding name

    This command tries to use the namespace name as the binding. Previously, we would unnecessarily error if this namespace name did not fit the binding name constraints. Now we accept such names and then remove invalid characters when generating the binding name.

3.28.3

Patch Changes

  • #5026 04584722 Thanks @dario-piotrowicz! - fix: make sure getPlatformProxy produces a production-like caches object

    make sure that the caches object returned to getPlatformProxy behaves in the same manner as the one present in production (where calling unsupported methods throws a helpful error message)

    note: make sure that the unsupported methods are however not included in the CacheStorage type definition

  • #5030 55ea0721 Thanks @mrbbot! - fix: don't suggest reporting user errors to GitHub

    Wrangler has two different types of errors: internal errors caused by something going wrong, and user errors caused by an invalid configuration. Previously, we would encourage users to submit bug reports for user errors, even though there's nothing we can do to fix them. This change ensures we only suggest this for internal errors.

  • #4900 3389f2e9 Thanks @OilyLime! - feature: allow hyperdrive users to set local connection string as environment variable

    Wrangler dev now supports the HYPERDRIVE_LOCAL_CONNECTION_STRING environmental variable for connecting to a local database instance when testing Hyperdrive in local development. This environmental variable takes precedence over the localConnectionString set in wrangler.toml.

  • #5033 b1ace91b Thanks @mrbbot! - fix: wait for actual port before opening browser with --port=0

    Previously, running wrangler dev --remote --port=0 and then immediately pressing b would open localhost:0 in your default browser. This change queues up opening the browser until Wrangler knows the port the dev server was started on.

  • #5026 04584722 Thanks @dario-piotrowicz! - fix: relax the getPlatformProxy's' cache request/response types

    prior to these changes the caches obtained from getPlatformProxy would use unknowns as their types, this proved too restrictive and incompatible with the equivalent @cloudflare/workers-types types, we decided to use anys instead to allow for more flexibility whilst also making the type compatible with workers-types

  • Updated dependencies [7723ac17, 027f9719, 027f9719, 027f9719, 027f9719, 027f9719, 027f9719]:

  • #4475 86d94ff Thanks @paulrostorp! - feat: support custom HTTPS certificate paths in Wrangler dev commands.

    Adds flags --https-key-path and --https-cert-path to wrangler dev and wrangler pages dev commands.

    Fixes #2118

3.28.2

Patch Changes

  • #4950 05360e43 Thanks @petebacondarwin! - fix: ensure we do not rewrite external Origin headers in wrangler dev

    In https://github.com/cloudflare/workers-sdk/pull/4812 we tried to fix the Origin headers to match the Host header but were overzealous and rewrote Origin headers for external origins (outside of the proxy server's origin).

    This is now fixed, and moreover we rewrite any headers that refer to the proxy server on the request with the configured host and vice versa on the response.

    This should ensure that CORS is not broken in browsers when a different host is being simulated based on routes in the Wrangler configuration.

  • #5002 315a651b Thanks @dario-piotrowicz! - chore: rename getBindingsProxy to getPlatformProxy

    initially getBindingsProxy was supposed to only provide proxies for bindings, the utility has however grown, including now cf, ctx and caches, to clarify the increased scope the utility is getting renamed to getPlatformProxy and its bindings field is getting renamed env

    note: getBindingProxy with its signature is still kept available, making this a non breaking change

  • Updated dependencies [05360e43]:

3.28.1

Patch Changes

  • #4962 d6585178 Thanks @mrbbot! - fix: ensure wrangler dev can reload without crashing when importing node:* modules

    The previous Wrangler release introduced a regression that caused reloads to fail when importing node:* modules. This change fixes that, and ensures these modules can always be resolved.

3.28.0

Minor Changes

  • #4499 cf9c029b Thanks @penalosa! - feat: Support runtime-agnostic polyfills

    Previously, Wrangler treated any imports of node:* modules as build-time errors (unless one of the two Node.js compatibility modes was enabled). This is sometimes overly aggressive, since those imports are often not hit at runtime (for instance, it was impossible to write a library that worked across Node.JS and Workers, using Node packages only when running in Node). Here's an example of a function that would cause Wrangler to fail to build:

    export function randomBytes(length: number) {
      if (navigator.userAgent !== "Cloudflare-Workers") {
        return new Uint8Array(require("node:crypto").randomBytes(length));
      } else {
        return crypto.getRandomValues(new Uint8Array(length));
      }
    }
    

    This function should work in both Workers and Node, since it gates Node-specific functionality behind a user agent check, and falls back to the built-in Workers crypto API. Instead, Wrangler detected the node:crypto import and failed with the following error:

    ✘ [ERROR] Could not resolve "node:crypto"
    
        src/randomBytes.ts:5:36:
          5 │ ... return new Uint8Array(require('node:crypto').randomBytes(length));
            ╵                                   ~~~~~~~~~~~~~
    
      The package "node:crypto" wasn't found on the file system but is built into node.
      Add "node_compat = true" to your wrangler.toml file to enable Node.js compatibility.
    

    This change turns that Wrangler build failure into a warning, which users can choose to ignore if they know the import of node:* APIs is safe (because it will never trigger at runtime, for instance):

    ▲ [WARNING] The package "node:crypto" wasn't found on the file system but is built into node.
    
      Your Worker may throw errors at runtime unless you enable the "nodejs_compat"
      compatibility flag. Refer to
      https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details.
      Imported from:
       - src/randomBytes.ts
    

    However, in a lot of cases, it's possible to know at build time whether the import is safe. This change also injects navigator.userAgent into esbuild's bundle settings as a predefined constant, which means that esbuild can tree-shake away imports of node:* APIs that are guaranteed not to be hit at runtime, supressing the warning entirely.

  • #4926 a14bd1d9 Thanks @dario-piotrowicz! - feature: add a cf field to the getBindingsProxy result

    Add a new cf field to the getBindingsProxy result that people can use to mock the production cf (IncomingRequestCfProperties) object.

    Example:

    const { cf } = await getBindingsProxy();
    
    console.log(`country = ${cf.country}; colo = ${cf.colo}`);
    

Patch Changes

  • #4931 321c7ed7 Thanks @dario-piotrowicz! - fix: make the entrypoint optional for the types command

    Currently running wrangler types against a wrangler.toml file without a defined entrypoint (main value) causes the command to error with the following message:

    ✘ [ERROR] Missing entry-point: The entry-point should be specified via the command line (e.g. `wrangler types path/to/script`) or the `main` config field.
    

    However developers could want to generate types without the entrypoint being defined (for example when using getBindingsProxy), so these changes make the entrypoint optional for the types command, assuming modules syntax if none is specified.

  • #4867 d637bd59 Thanks @RamIdeas! - fix: inflight requests to UserWorker which failed across reloads are now retried

    Previously, when running wrangler dev, requests inflight during a UserWorker reload (due to config or source file changes) would fail.

    Now, if those inflight requests are GET or HEAD requests, they will be reproxied against the new UserWorker. This adds to the guarantee that requests made during local development reach the latest worker.

  • #4938 75bd08ae Thanks @rozenmd! - fix: print wrangler banner at the start of every d1 command

    This PR adds a wrangler banner to the start of every D1 command (except when invoked in JSON-mode)

    For example:

     ⛅️ wrangler 3.27.0
    -------------------
    ...
    
  • #4953 d96bc7dd Thanks @mrbbot! - fix: allow port option to be specified with unstable_dev()

    Previously, specifying a non-zero port when using unstable_dev() would try to start two servers on that port. This change ensures we only start the user-facing server on the specified port, allow unstable_dev() to startup correctly.

3.27.0

Minor Changes

  • #4877 3e7cd6e4 Thanks @magnusdahlstrand! - fix: Do not show unnecessary errors during watch rebuilds

    When Pages is used in conjunction with a full stack framework, the framework build will temporarily remove files that are being watched by Pages, such as _worker.js and _routes.json. Previously we would display errors for these changes, which adds confusing and excessive messages to the Pages dev output. Now builds are skipped if a watched _worker.js or _routes.json is removed.

  • #4901 2469e9fa Thanks @penalosa! - feature: implemented Python support in Wrangler

    Python Workers are now supported by wrangler deploy and wrangler dev.

  • #4922 4c7031a6 Thanks @dario-piotrowicz! - feature: add a ctx field to the getBindingsProxy result

    Add a new ctx filed to the getBindingsProxy result that people can use to mock the production ExecutionContext object.

    Example:

    const { ctx } = await getBindingsProxy();
    ctx.waitUntil(myPromise);
    

Patch Changes

  • #4907 583e4451 Thanks @mrbbot! - fix: mark R2 object and bucket not found errors as unreportable

    Previously, running wrangler r2 objects {get,put} with an object or bucket that didn't exist would ask if you wanted to report that error to Cloudflare. There's nothing we can do to fix this, so this change prevents the prompt in this case.

  • #4872 5ef56067 Thanks @rozenmd! - fix: intercept and stringify errors thrown by d1 execute in --json mode

    Prior to this PR, if a query threw an error when run in wrangler d1 execute ... --json, wrangler would swallow the error.

    This PR returns the error as JSON. For example, the invalid query SELECT asdf; now returns the following in JSON mode:

    {
      "error": {
        "text": "A request to the Cloudflare API (/accounts/xxxx/d1/database/xxxxxxx/query) failed.",
        "notes": [
          {
            "text": "no such column: asdf at offset 7 [code: 7500]"
          }
        ],
        "kind": "error",
        "name": "APIError",
        "code": 7500
      }
    }
    
  • #4888 3679bc18 Thanks @petebacondarwin! - fix: ensure that the Pages dev proxy server does not change the Host header

    Previously, when configuring wrangler pages dev to use a proxy to a 3rd party dev server, the proxy would replace the Host header, resulting in problems at the dev server if it was checking for cross-site scripting attacks.

    Now the proxy server passes through the Host header unaltered making it invisible to the 3rd party dev server.

    Fixes #4799

  • #4909 34b6ea1e Thanks @rozenmd! - feat: add an experimental insights command to wrangler d1

    This PR adds a wrangler d1 insights <DB_NAME> command, to let D1 users figure out which of their queries to D1 need to be optimised.

    This command defaults to fetching the top 5 queries that took the longest to run in total over the last 24 hours.

    You can also fetch the top 5 queries that consumed the most rows read over the last week, for example:

    npx wrangler d1 insights northwind --sortBy reads --timePeriod 7d
    

    Or the top 5 queries that consumed the most rows written over the last month, for example:

    npx wrangler d1 insights northwind --sortBy writes --timePeriod 31d
    

    Or the top 5 most frequently run queries in the last 24 hours, for example:

    npx wrangler d1 insights northwind --sortBy count
    
  • #4830 48f90859 Thanks @Lekensteyn! - fix: listen on loopback for wrangler dev port check and login

    Avoid listening on the wildcard address by default to reduce the attacker's surface and avoid firewall prompts on macOS.

    Relates to #4430.

  • #4907 583e4451 Thanks @mrbbot! - fix: ensure wrangler dev --log-level flag applied to all logs

    Previously, wrangler dev may have ignored the --log-level flag for some startup logs. This change ensures the --log-level flag is applied immediately.

  • Updated dependencies [148feff6]:

3.26.0

Minor Changes

  • #4847 6968e11f Thanks @dario-piotrowicz! - feature: expose new (no-op) caches field in getBindingsProxy result

    Add a new caches field to the getBindingsProxy result, such field implements a no operation (no-op) implementation of the runtime caches

    Note: Miniflare exposes a proper caches mock, we will want to use that one in the future but issues regarding it must be ironed out first, so for the time being a no-op will have to do

Patch Changes

  • #4860 b92e5ac0 Thanks @Sibirius! - fix: allow empty strings in secret:bulk upload

    Previously, the secret:bulk command would fail if any of the secrets in the secret.json file were empty strings and they already existed remotely.

  • #4869 fd084bc0 Thanks @jculvey! - feature: Expose AI bindings to getBindingsProxy.

    The getBindingsProxy utility function will now contain entries for any AI bindings specified in wrangler.toml.

  • #4880 65da40a1 Thanks @petebacondarwin! - fix: do not attempt login during dry-run

    The "standard pricing" warning was attempting to make an API call that was causing a login attempt even when on a dry-run. Now this warning is disabled during dry-runs.

    Fixes #4723

3.25.0

Minor Changes

  • #4815 030360d6 Thanks @jonesphillip! - feature: adds support for configuring Sippy with Google Cloud Storage (GCS) provider.

    Sippy (https://developers.cloudflare.com/r2/data-migration/sippy/) now supports Google Cloud Storage. This change updates the wrangler r2 sippy commands to take a provider (AWS or GCS) and appropriate configuration arguments. If you don't specify --provider argument then the command will enter an interactive flow for the user to set the configuration. Note that this is a breaking change from the previous behaviour where you could configure AWS as the provider without explictly specifying the --provider argument. (This breaking change is allowed in a minor release because the Sippy feature and wrangler r2 sippy commands are marked as beta.)

Patch Changes

  • #4841 10396125 Thanks @rozenmd! - fix: replace D1's dashed time-travel endpoints with underscored ones

    D1 will maintain its d1/database/${databaseId}/time-travel/* endpoints until GA, at which point older versions of wrangler will start throwing errors to users, asking them to upgrade their wrangler version to continue using Time Travel via CLI.

  • #4656 77b0bce3 Thanks @petebacondarwin! - fix: ensure upstream_protocol is passed to the Worker

    In wrangler dev it is possible to set the upstream_protocol, which is the protocol under which the User Worker believes it has been requested, as recorded in the request.url that can be used for forwarding on requests to the origin.

    Previously, it was not being passed to wrangler dev in local mode. Instead it was always set to http.

    Note that setting upstream_protocol to http is not supported in wrangler dev remote mode, which is the case since Wrangler v2.0.

    This setting now defaults to https in remote mode (since that is the only option), and to the same as local_protocol in local mode.

    Fixes #4539

  • #4810 6eb2b9d1 Thanks @gabivlj! - fix: Cloudchamber command shows json error message on load account if --json specified

    If the user specifies a json option, we should see a more detailed error on why loadAccount failed.

  • #4820 b01c1548 Thanks @mrbbot! - fix: show up-to-date sources in DevTools when saving source files

    Previously, DevTools would never refresh source contents after opening a file, even if it was updated on-disk. This could cause issues with step-through debugging as breakpoints set in source files would map to incorrect locations in bundled Worker code. This change ensures DevTools' source cache is cleared on each reload, preventing outdated sources from being displayed.

  • Updated dependencies [8166eefc]:

3.24.0

Minor Changes

  • #4523 9f96f28b Thanks @dario-piotrowicz! - Add new getBindingsProxy utility to the wrangler package

    The new utility is part of wrangler's JS API (it is not part of the wrangler CLI) and its use is to provide proxy objects to bindings, such objects can be used in Node.js code as if they were actual bindings

    The utility reads the wrangler.toml file present in the current working directory in order to discern what bindings should be available (a wrangler.json file can be used too, as well as config files with custom paths).

    Example

    Assuming that in the current working directory there is a wrangler.toml file with the following content:

    [[kv_namespaces]]
    binding = "MY_KV"
    id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    

    The utility could be used in a nodejs script in the following way:

    import { getBindingsProxy } from "wrangler";
    
    const { bindings, dispose } = await getBindingsProxy();
    
    try {
      const myKv = bindings.MY_KV;
      const kvValue = await myKv.get("my-kv-key");
    
      console.log(`KV Value = ${kvValue}`);
    } finally {
      await dispose();
    }
    

Patch Changes

  • #3427 b79e93a3 Thanks @ZakKemble! - fix: Use Windows SYSTEMROOT env var for finding netstat

    Currently, the drive letter of os.homedir() (the user's home directory) is used to build the path to netstat.exe. However, user directories are not always on the same drive as the Windows installation, in which case the path to netstat will be incorrect. Now we use the %SYSTEMROOT% environment variable which correctly points to the installation path of Windows.

3.23.0

Minor Changes

Patch Changes

  • #4674 54ea6a53 Thanks @matthewdavidrodgers! - Fix usage of patch API in bulk secrets update

    Only specifying the name and type of a binding instructs the patch API to copy the existing binding over - but we were including the contents of the binding as well. Normally that's OK, but there are some subtle differences between what you specify to create a binding vs what it looks like once it's created, specifically for Durable Objects. So instead, we just use the simpler inheritance.

  • #4772 4a9f03cf Thanks @mrbbot! - fix: ensure dev server doesn't change request URLs

    Previously, Wrangler's dev server could change incoming request URLs unexpectedly (e.g. rewriting http://localhost:8787//test to http://localhost:8787/test). This change ensures URLs are passed through without modification.

    Fixes #4743.

3.22.5

Patch Changes

  • #4707 96a27f3d Thanks @mrbbot! - fix: only offer to report unknown errors

    Previously, Wrangler would offer to report any error to Cloudflare. This included errors caused by misconfigurations or invalid commands. This change ensures those types of errors aren't reported.

  • #4722 5af6df13 Thanks @mrbbot! - fix: don't require auth for wrangler r2 object --local operations

    Previously, Wrangler would ask you to login when reading or writing from local R2 buckets. This change ensures no login prompt is displayed, as authentication isn't required for these operations.

  • #4719 c37d94b5 Thanks @mrbbot! - fix: ensure miniflare and wrangler can source map in the same process

    Previously, if in a wrangler dev session you called console.log() and threw an unhandled error you'd see an error like [ERR_ASSERTION]: The expression evaluated to a falsy value. This change ensures you can do both of these things in the same session.

  • #4683 24147166 Thanks @mrbbot! - fix: ensure logs containing at not truncated to at [object Object]

    Previously, logs containing at were always treated as stack trace call sites requiring source mapping. This change updates the call site detection to avoid false positives.

  • #4748 3603a60d Thanks @Cherry! - fix: resolve imports in a more node-like fashion for packages that do not declare exports

    Previously, trying to import a file that wasn't explicitly exported from a module would result in an error, but now, better attempts are made to resolve the import using node's module resolution algorithm. It's now possible to do things like this:

    import JPEG_DEC_WASM from "@jsquash/jpeg/codec/dec/mozjpeg_dec.wasm";
    

    This works even if the mozjpeg_dec.wasm file isn't explicitly exported from the @jsquash/jpeg module.

    Fixes #4726

  • #4687 0a488f66 Thanks @mrbbot! - fix: remove confusing --local messaging from wrangler pages dev

    Running wrangler pages dev would previously log a warning saying --local is no longer required even though --local was never set. This change removes this warning.

  • Updated dependencies [4f6999ea, c37d94b5]:

3.22.4

Patch Changes

  • #4699 4b4c1416 Thanks @mrbbot! - fix: prevent repeated reloads with circular service bindings

    wrangler@3.19.0 introduced a bug where starting multiple wrangler dev sessions with service bindings to each other resulted in a reload loop. This change ensures Wrangler only reloads when dependent wrangler dev sessions start/stop.

3.22.3

Patch Changes

  • #4693 93e88c43 Thanks @mrbbot! - fix: ensure wrangler dev exits with code 0 on clean exit

    Previously, wrangler dev would exit with a non-zero exit code when pressing CTRL+C or x. This change ensures wrangler exits with code 0 in these cases.

  • #4630 037de5ec Thanks @petebacondarwin! - fix: ensure User Worker gets the correct Host header in wrangler dev local mode

    Some full-stack frameworks, such as Next.js, check that the Host header for a server side action request matches the host where the application is expected to run.

    In wrangler dev we have a Proxy Worker in between the browser and the actual User Worker. This Proxy Worker is forwarding on the request from the browser, but then the actual User Worker is running on a different host:port combination than that which the browser thinks it should be on. This was causing the framework to think the request is malicious and blocking it.

    Now we update the request's Host header to that passed from the Proxy Worker in a custom MF-Original-Url header, but only do this if the request also contains a shared secret between the Proxy Worker and User Worker, which is passed via the MF-Proxy-Shared-Secret header. This last feature is to prevent a malicious website from faking the Host header in a request directly to the User Worker.

    Fixes https://github.com/cloudflare/next-on-pages/issues/588

  • #4695 0f8a03c0 Thanks @mrbbot! - fix: ensure API failures without additional messages logged correctly
  • #4693 93e88c43 Thanks @mrbbot! - fix: ensure wrangler pages dev exits cleanly

    Previously, pressing CTRL+C or x when running wrangler pages dev wouldn't actually exit wrangler. You'd need to press CTRL+C a second time to exit the process. This change ensures wrangler exits the first time.

  • #4696 624084c4 Thanks @mrbbot! - fix: include additional modules in largest dependencies warning

    If your Worker fails to deploy because it's too large, Wrangler will display of list of your Worker's largest dependencies. Previously, this just included JavaScript dependencies. This change ensures additional module dependencies (e.g. WebAssembly, text blobs, etc.) are included when computing this list.

  • Updated dependencies [037de5ec]:

3.22.2

Patch Changes

  • #4600 4233e514 Thanks @mrbbot! - fix: apply source mapping to deployment validation errors

    Previously if a Worker failed validation during wrangler deploy, the displayed error would reference locations in built JavaScript files. This made it more difficult to debug validation errors. This change ensures these errors are now source mapped, referencing locations in source files instead.

  • #4440 15717333 Thanks @mrbbot! - fix: automatically create required directories for wrangler r2 object get

    Previously, if you tried to use wrangler r2 object get with an object name containing a / or used the --file flag with a path containing a /, and the specified directory didn't exist, Wrangler would throw an ENOENT error. This change ensures Wrangler automatically creates required parent directories if they don't exist.

  • #4592 20da658e Thanks @mrbbot! - fix: throw helpful error if email validation required

    Previously, Wrangler would display the raw API error message and code if email validation was required during wrangler deploy. This change ensures a helpful error message is displayed instead, prompting users to check their emails or visit the dashboard for a verification link.

  • #4597 e1d50407 Thanks @mrbbot! - fix: suggest checking permissions on authentication error with API token set
  • #4588 4e5ed0b2 Thanks @mrbbot! - fix: require worker name for rollback

    Previously, Wrangler would fail with a cryptic error if you tried to run wrangler rollback outside of a directory containing a Wrangler configuration file with a name defined. This change validates that a worker name is defined, and allows you to set it from the command line using the --name flag.

  • Updated dependencies [c410ea14]:

3.22.1

Patch Changes

  • #4635 5bc2699d Thanks @mrbbot! - fix: prevent zombie workerd processes

    Previously, running wrangler dev would leave behind "zombie" workerd processes. These processes prevented the same port being bound if wrangler dev was restarted and sometimes consumed lots of CPU time. This change ensures all workerd processes are killed when wrangler dev is shutdown.

    To clean-up existing zombie processes, run pkill -KILL workerd on macOS/Linux or taskkill /f /im workerd.exe on Windows.

3.22.0

Minor Changes

  • #4632 a6a4e8a4 Thanks @G4brym! - Deprecate constellation commands and add a warning when using the constellation binding
  • #4621 98dee932 Thanks @rozenmd! - feat: add rows written/read in the last 24 hours to wrangler d1 info output

3.21.0

Minor Changes

  • #4423 a94ef570 Thanks @mrbbot! - feat: apply source mapping to logged strings

    Previously, Wrangler would only apply source mapping to uncaught exceptions. This meant if you caught an exception and logged its stack trace, the call sites would reference built JavaScript files as opposed to source files. This change looks for stack traces in logged messages, and tries to source map them.

    Note source mapping is only applied when outputting logs. Error#stack does not return a source mapped stack trace. This means the actual runtime value of new Error().stack and the output from console.log(new Error().stack) may be different.

Patch Changes

  • #4511 66394681 Thanks @huw! - Add 'took recursive isolate lock' warning to workerd output exceptions

3.20.0

Minor Changes

  • #4571 3314dbde Thanks @penalosa! - feat: When Wrangler crashes, send an error report to Sentry to aid in debugging.

    When Wrangler's top-level exception handler catches an error thrown from Wrangler's application, it will offer to report the error to Sentry. This requires opt-in from the user every time.

Patch Changes

3.19.0

Minor Changes

  • #4547 86c81ff0 Thanks @mrbbot! - fix: listen on IPv4 loopback only by default on Windows

    Due to a known issue, workerd will only listen on the IPv4 loopback address 127.0.0.1 when it's asked to listen on localhost. On Node.js > 17, localhost will resolve to the IPv6 loopback address, meaning requests to workerd would fail. This change switches to using the IPv4 loopback address throughout Wrangler on Windows, while workerd#1408 gets fixed.

  • #4535 29df8e17 Thanks @mrbbot! - Reintroduces some internal refactorings of wrangler dev servers (including wrangler dev, wrangler dev --remote, and unstable_dev()).

    These changes were released in 3.13.0 and reverted in 3.13.1 -- we believe the changes are now more stable and ready for release again.

    There are no changes required for developers to opt-in. Improvements include:

    • fewer 'address in use' errors upon reloads
    • upon config/source file changes, requests are buffered to guarantee the response is from the new version of the Worker

Patch Changes

  • #4521 6c5bc704 Thanks @zebp! - fix: init from dash specifying explicit usage model in wrangler.toml for standard users
  • #4550 63708a94 Thanks @mrbbot! - fix: validate Host and Orgin headers where appropriate

    Host and Origin headers are now checked when connecting to the inspector and Miniflare's magic proxy. If these don't match what's expected, the request will fail.

  • Updated dependencies [71fb0b86, 63708a94]:

3.18.0

Minor Changes

  • #4532 311ffbd5 Thanks @mrbbot! - fix: change wrangler (pages) dev to listen on localhost by default

    Previously, Wrangler listened on all interfaces (*) by default. This change switches wrangler (pages) dev to just listen on local interfaces. Whilst this is technically a breaking change, we've decided the security benefits outweigh the potential disruption caused. If you need to access your dev server from another device on your network, you can use wrangler (pages) dev --ip * to restore the previous behaviour.

Patch Changes

3.17.1

Patch Changes

  • #4474 382ef8f5 Thanks @mrbbot! - fix: open browser to correct url pressing b in --remote mode

    This change ensures Wrangler doesn't try to open http://* when * is used as the dev server's hostname. Instead, Wrangler will now open http://127.0.0.1.

  • #4488 3bd57238 Thanks @RamIdeas! - Changes the default directory for log files to workaround frameworks that are watching the entire .wrangler directory in the project root for changes

    Also includes a fix for commands with --json where the log file location message would cause stdout to not be valid JSON. That message now goes to stderr.

3.17.0

Minor Changes

  • #4341 d9908743 Thanks @RamIdeas! - Wrangler now writes all logs to a .log file in the .wrangler directory. Set a directory or specific .log filepath to write logs to with WRANGLER_LOG_PATH=../Desktop/my-logs/ or WRANGLER_LOG_PATH=../Desktop/my-logs/my-log-file.log. When specifying a directory or using the default location, a filename with a timestamp is used.

    Wrangler now filters workerd stdout/stderr and marks unactionable messages as debug logs. These debug logs are still observable in the debug log file but will no longer show in the terminal by default without the user setting the env var WRANGLER_LOG=debug.

Patch Changes

  • #4469 d5e1966b Thanks @mrbbot! - fix: report correct line and column numbers when source mapping errors with wrangler dev --remote

3.16.0

Minor Changes

  • #4347 102e15f9 Thanks @Skye-31! - Feat(unstable_dev): Provide an option for unstable_dev to perform the check that prompts users to update wrangler, defaulting to false. This will prevent unstable_dev from sending a request to NPM on startup to determine whether it needs to be updated.
  • #4179 dd270d00 Thanks @matthewdavidrodgers! - Simplify secret:bulk api via script settings

    Firing PUTs to the secret api in parallel has never been a great solution - each request independently needs to lock the script, so running in parallel is at best just as bad as running serially.

    Luckily, we have the script settings PATCH api now, which can update the settings for a script (including secret bindings) at once, which means we don't need any parallelization. However this api doesn't work with a partial list of bindings, so we have to fetch the current bindings and merge in with the new secrets before PATCHing. We can however just omit the value of the binding (i.e. only provide the name and type) which instructs the config service to inherit the existing value, which simplifies this as well. Note that we don't use the bindings in your current wrangler.toml, as you could be in a draft state, and it makes sense as a user that a bulk secrets update won't update anything else. Instead, we use script settings api again to fetch the current state of your bindings.

    This simplified implementation means the operation can only fail or succeed, rather than succeeding in updating some secrets but failing for others. In order to not introduce breaking changes for logging output, the language around "${x} secrets were updated" or "${x} secrets failed" is kept, even if it doesn't make much sense anymore.

Patch Changes

  • #4402 baa76e77 Thanks @rozenmd! - This PR adds a fetch handler that uses page, assuming result_info provided by the endpoint contains page, per_page, and total

    This is needed as the existing fetchListResult handler for fetching potentially paginated results doesn't work for endpoints that don't implement cursor.

    Fixes #4349

  • #4337 6c8f41f8 Thanks @Skye-31! - Improve the error message when a script isn't exported a Durable Object class

    Previously, wrangler would error with a message like Uncaught TypeError: Class extends value undefined is not a constructor or null. This improves that messaging to be more understandable to users.

  • #4307 7fbe1937 Thanks @jspspike! - Change local dev server default ip to * instead of 0.0.0.0. This will cause the dev server to listen on both ipv4 and ipv6 interfaces

3.15.0

Minor Changes

  • #4209 24d1c5cf Thanks @mrbbot! - fix: suppress compatibility date fallback warnings if no wrangler update is available

    If a compatibility date greater than the installed version of workerd was configured, a warning would be logged. This warning was only actionable if a new version of wrangler was available. The intent here was to warn if a user set a new compatibility date, but forgot to update wrangler meaning changes enabled by the new date wouldn't take effect. This change hides the warning if no update is available.

    It also changes the default compatibility date for wrangler dev sessions without a configured compatibility date to the installed version of workerd. This previously defaulted to the current date, which may have been unsupported by the installed runtime.

  • #4135 53218261 Thanks @Cherry! - feat: resolve npm exports for file imports

    Previously, when using wasm (or other static files) from an npm package, you would have to import the file like so:

    import wasm from "../../node_modules/svg2png-wasm/svg2png_wasm_bg.wasm";
    

    This update now allows you to import the file like so, assuming it's exposed and available in the package's exports field:

    import wasm from "svg2png-wasm/svg2png_wasm_bg.wasm";
    

    This will look at the package's exports field in package.json and resolve the file using resolve.exports.

  • #4232 69b43030 Thanks @romeupalos! - fix: use zone_name to determine a zone when the pattern is a custom hostname

    In Cloudflare for SaaS, custom hostnames of third party domain owners can be used in Cloudflare. Workers are allowed to intercept these requests based on the routes configuration. Before this change, the same logic used by wrangler dev was used in wrangler deploy, which caused wrangler to fail with:

    ✘ [ERROR] Could not find zone for [partner-saas-domain.com]

  • #4198 b404ab70 Thanks @penalosa! - When uploading additional modules with your worker, Wrangler will now report the (uncompressed) size of each individual module, as well as the aggregate size of your Worker

Patch Changes

  • #4215 950bc401 Thanks @RamIdeas! - fix various logging of shell commands to correctly quote args when needed
  • #4274 be0c6283 Thanks @jspspike! - chore: bump miniflare to 3.20231025.0

    This change enables Node-like console.log()ing in local mode. Objects with lots of properties, and instances of internal classes like Request, Headers, ReadableStream, etc will now be logged with much more detail.

  • #4127 3d55f965 Thanks @mrbbot! - fix: store temporary files in .wrangler

    As Wrangler builds your code, it writes intermediate files to a temporary directory that gets cleaned up on exit. Previously, Wrangler used the OS's default temporary directory. On Windows, this is usually on the C: drive. If your source code was on a different drive, our bundling tool would generate invalid source maps, breaking breakpoint debugging. This change ensures intermediate files are always written to the same drive as sources. It also ensures unused build outputs are cleaned up when running wrangler pages dev.

    This change also means you no longer need to set cwd and resolveSourceMapLocations in .vscode/launch.json when creating an attach configuration for breakpoint debugging. Your .vscode/launch.json should now look something like...

    {
      "configurations": [
        {
          "name": "Wrangler",
          "type": "node",
          "request": "attach",
          "port": 9229,
          // These can be omitted, but doing so causes silent errors in the runtime
          "attachExistingChildren": false,
          "autoAttachChildProcesses": false
        }
      ]
    }
    
  • #4189 05798038 Thanks @gabivlj! - Move helper cli files of C3 into @cloudflare/cli and make Wrangler and C3 depend on it
  • #4235 46cd2df5 Thanks @mrbbot! - fix: ensure console.log()s during startup are displayed

    Previously, console.log() calls before the Workers runtime was ready to receive requests wouldn't be shown. This meant any logs in the global scope likely weren't visible. This change ensures startup logs are shown. In particular, this should fix Remix's HMR, which relies on startup logs to know when the Worker is ready.

3.14.0

Minor Changes

  • #4204 38fdbe9b Thanks @matthewdavidrodgers! - Support user limits for CPU time

    User limits provided via script metadata on upload

    Example configuration:

    [limits]
    cpu_ms = 20000
    
  • #2162 a1f212e6 Thanks @WalshyDev! - add support for service bindings in wrangler pages dev by providing the new --service|-s flag which accepts an array of BINDING_NAME=SCRIPT_NAME where BINDING_NAME is the name of the binding and SCRIPT_NAME is the name of the worker (as defined in its wrangler.toml), such workers need to be running locally with with wrangler dev.

    For example if a user has a worker named worker-a, in order to locally bind to that they'll need to open two different terminals, in each navigate to the respective worker/pages application and then run respectively wrangler dev and wrangler pages ./publicDir --service MY_SERVICE=worker-a this will add the MY_SERVICE binding to pages' worker env object.

    Note: additionally after the SCRIPT_NAME the name of an environment can be specified, prefixed by an @ (as in: MY_SERVICE=SCRIPT_NAME@PRODUCTION), this behavior is however experimental and not fully properly defined.

3.13.2

Patch Changes

3.13.1

Patch Changes

  • #4171 88f15f61 Thanks @penalosa! - patch: This release fixes some regressions related to running wrangler dev that were caused by internal refactoring of the dev server architecture (#3960). The change has been reverted, and will be added back in a future release.

3.13.0

Minor Changes

  • #3960 c36b78b4 Thanks @RamIdeas! - Refactoring the internals of wrangler dev servers (including wrangler dev, wrangler dev --remote and unstable_dev()).

    There are no changes required for developers to opt-in. Improvements include:

    • fewer 'address in use' errors upon reloads
    • upon config/source file changes, requests are buffered to guarantee the response is from the new version of the Worker

Patch Changes

  • #3590 f4ad634a Thanks @penalosa! - fix: When a middleware is configured which doesn't support your Worker's script format, fail early with a helpful error message

3.12.0

Minor Changes

  • #4071 f880a009 Thanks @matthewdavidrodgers! - Support TailEvent messages in Tail sessions

    When tailing a tail worker, messages previously had a null event property. Following https://github.com/cloudflare/workerd/pull/1248, these events have a valid event, specifying which scripts produced events that caused your tail worker to run.

    As part of rolling this out, we're filtering out tail events in the internal tail infrastructure, so we control when these new messages are forward to tail sessions, and can merge this freely.

    One idiosyncracy to note, however, is that tail workers always report an "OK" status, even if they run out of memory or throw. That is being tracked and worked on separately.

  • #2397 93833f04 Thanks @a-robinson! - feature: Support Queue consumer events in tail

    So that it's less confusing when tailing a worker that consumes events from a Queue.

Patch Changes

  • #2687 3077016f Thanks @jrf0110! - Fixes large Pages projects failing to complete direct upload due to expiring JWTs

    For projects which are slow to upload - either because of client bandwidth or large numbers of files and sizes - It's possible for the JWT to expire multiple times. Since our network request concurrency is set to 3, it's possible that each time the JWT expires we get 3 failed attempts. This can quickly exhaust our upload attempt count and cause the entire process to bail.

    This change makes it such that jwt refreshes do not count as a failed upload attempt.

  • #4069 f4d28918 Thanks @a-robinson! - Default new Hyperdrive configs for PostgreSQL databases to port 5432 if the port is not specified

3.11.0

Minor Changes

  • #3726 7d20bdbd Thanks @petebacondarwin! - feat: support partial bundling with configurable external modules

    Setting find_additional_modules to true in your configuration file will now instruct Wrangler to look for files in your base_dir that match your configured rules, and deploy them as unbundled, external modules with your Worker. base_dir defaults to the directory containing your main entrypoint.

    Wrangler can operate in two modes: the default bundling mode and --no-bundle mode. In bundling mode, dynamic imports (e.g. await import("./large-dep.mjs")) would be bundled into your entrypoint, making lazy loading less effective. Additionally, variable dynamic imports (e.g. await import(`./lang/${language}.mjs`)) would always fail at runtime, as Wrangler would have no way of knowing which modules to upload. The --no-bundle mode sought to address these issues by disabling Wrangler's bundling entirely, and just deploying code as is. Unfortunately, this also disabled Wrangler's code transformations (e.g. TypeScript compilation, --assets, --test-scheduled, etc).

    With this change, we now additionally support partial bundling. Files are bundled into a single Worker entry-point file unless find_additional_modules is true, and the file matches one of the configured rules. See https://developers.cloudflare.com/workers/wrangler/bundling/ for more details and examples.

Patch Changes

  • #3726 7d20bdbd Thanks @petebacondarwin! - fix: ensure that additional modules appear in the out-dir

    When using find_additional_modules (or no_bundle) we find files that will be uploaded to be deployed alongside the Worker.

    Previously, if an outDir was specified, only the Worker code was output to this directory. Now all additional modules are also output there too.

  • #4067 31270711 Thanks @mrbbot! - fix: generate valid source maps with wrangler pages dev on macOS

    On macOS, wrangler pages dev previously generated source maps with an incorrect number of ../s in relative paths. This change ensures paths are always correct, improving support for breakpoint debugging.

  • #4084 9a7559b6 Thanks @RamIdeas! - fix: respect the options.local value in unstable_dev (it was being ignored)
  • #3726 7d20bdbd Thanks @petebacondarwin! - fix: allow __STATIC_CONTENT_MANIFEST module to be imported anywhere

    __STATIC_CONTENT_MANIFEST can now be imported in subdirectories when --no-bundle or find_additional_modules are enabled.

  • #4066 c8b4a07f Thanks @RamIdeas! - fix: we no longer infer pathnames from route patterns as the host

    During local development, inside your worker, the host of request.url is inferred from the routes in your config.

    Previously, route patterns like "*/some/path/name" would infer the host as "some". We now handle this case and determine we cannot infer a host from such patterns.

3.10.1

Patch Changes

  • #4041 6b1c327d Thanks @elithrar! - Fixed a bug in Vectorize that send preset configurations with the wrong key. This was patched on the server-side to work around this for users in the meantime.
  • #4054 f8c52b93 Thanks @mrbbot! - fix: allow wrangler pages dev sessions to be reloaded

    Previously, wrangler pages dev attempted to send messages on a closed IPC channel when sources changed, resulting in an ERR_IPC_CHANNEL_CLOSED error. This change ensures the channel stays open until the user exits wrangler pages dev.

3.10.0

Minor Changes

Patch Changes

  • #4034 bde9d64a Thanks @ndisidore! - Adds Vectorize support uploading batches of newline delimited json (ndjson) vectors from a source file. Load a dataset with vectorize insert my-index --file vectors.ndjson

3.9.1

Patch Changes

  • #3992 35564741 Thanks @edevil! - Add AI binding that will be used to interact with the AI project.

    Example wrangler.toml

    name = "ai-worker"
    main = "src/index.ts"
    
    [ai]
    binding = "AI"
    

    Example script:

    import Ai from "@cloudflare/ai"
    
    export default {
        async fetch(request: Request, env: Env): Promise<Response> {
            const ai = new Ai(env.AI);
    
            const story = await ai.run({
                model: 'llama-2',
                input: {
                    prompt: 'Tell me a story about the future of the Cloudflare dev platform'
                }
            });
    
        return new Response(JSON.stringify(story));
        },
    };
    
    export interface Env {
        AI: any;
    }
    
  • #4006 bc8c147a Thanks @rozenmd! - fix: remove warning around using D1's binding, and clean up the epilogue when running D1 commands

3.9.0

Minor Changes

  • #3951 e0850ad1 Thanks @mrbbot! - feat: add support for breakpoint debugging to wrangler dev's --remote and --no-bundle modes

    Previously, breakpoint debugging using Wrangler's DevTools was only supported in local mode, when using Wrangler's built-in bundler. This change extends that to remote development, and --no-bundle.

    When using --remote and --no-bundle together, uncaught errors will now be source-mapped when logged too.

  • #3951 e0850ad1 Thanks @mrbbot! - feat: add support for Visual Studio Code's built-in breakpoint debugger

    Wrangler now supports breakpoint debugging with Visual Studio Code's debugger. Create a .vscode/launch.json file with the following contents...

    {
      "configurations": [
        {
          "name": "Wrangler",
          "type": "node",
          "request": "attach",
          "port": 9229,
          "cwd": "/",
          "resolveSourceMapLocations": null,
          "attachExistingChildren": false,
          "autoAttachChildProcesses": false
        }
      ]
    }
    

    ...then run wrangler dev, and launch the configuration.

Patch Changes

  • #3928 95b24b1e Thanks @JacobMGEvans! - Colorize Deployed Bundle Size Most bundlers, and other tooling that give you size outputs will colorize their the text to indicate if the value is within certain ranges. The current range values are: red 100% - 90% yellow 89% - 70% green <70%

    resolves #1312

3.8.0

Minor Changes

  • #3775 3af30879 Thanks @bthwaites! - R2 Jurisdictional Restrictions guarantee objects in a bucket are stored within a specific jurisdiction. Wrangler now allows you to interact with buckets in a defined jurisdiction.

    Wrangler R2 operations now support a -J flag that allows the user to specify a jurisdiction. When passing the -J flag, you will only be able to interact with R2 resources within that jurisdiction.

    # List all of the buckets in the EU jurisdiction
    wrangler r2 bucket list -J eu
    # Downloads the object 'myfile.txt' from the bucket 'mybucket' in EU jurisdiction
    wrangler r2 object get mybucket/myfile.txt -J eu
    

    To access R2 buckets that belong to a jurisdiction from Workers, you will need to specify the jurisdiction as well as the bucket name as part of your bindings in your wrangler.toml:

    [[r2_buckets]]
    bindings = [
      { binding = "MY_BUCKET", bucket_name = "<YOUR_BUCKET_NAME>", jurisdiction = "<JURISDICTION>" }
    ]
    

Patch Changes

3.7.0

Minor Changes

  • #3774 ae2d5cb5 Thanks @mrbbot! - feat: support breakpoint debugging in local mode

    wrangler dev now supports breakpoint debugging in local mode! Press d to open DevTools and set breakpoints.

3.6.0

Minor Changes

Patch Changes

  • #3762 18dc7b54 Thanks @GregBrimble! - feat: Add internal wrangler pages project validate [directory] command which validates an asset directory
  • #3758 0adccc71 Thanks @jahands! - fix: Retry deployment errors in wrangler pages publish

    This will improve reliability when deploying to Cloudflare Pages

3.5.1

Patch Changes

3.5.0

Minor Changes

  • #3703 e600f029 Thanks @jspspike! - Added --local option for r2 commands to interact with local persisted r2 objects
  • #3704 8e231afd Thanks @JacobMGEvans! - secret:bulk exit 1 on failure Previously secret"bulk would only log an error on failure of any of the upload requests. Now when 'secret:bulk' has an upload request fail it throws an Error which sends an process.exit(1) at the root .catch() signal. This will enable error handling in programmatic uses of secret:bulk.
  • #3684 ff8603b6 Thanks @jspspike! - Added --local option for kv commands to interact with local persisted kv entries
  • #3595 c302bec6 Thanks @geelen! - Removing the D1 shim from the build process, in preparation for the Open Beta. D1 can now be used with --no-bundle enabled.
  • #3707 6de3c5ec Thanks @dario-piotrowicz! - Added handling of .mjs files to be picked up by inside the Pages _worker.js directory (currently only .js files are)

Patch Changes

3.4.0

Minor Changes

  • #3649 e2234bbc Thanks @JacobMGEvans! - Feature: 'stdin' support for 'secret:bulk' Added functionality that allows for files and strings to be piped in, or other means of standard input. This will allow for a broader variety of use cases and improved DX. This implementation is also fully backward compatible with the previous input method of file path to JSON.

    # Example of piping in a file
    > cat ./my-file.json | wrangler secret:bulk
    
    # Example of piping in a string
    > echo '{"key":"value"}' | wrangler secret:bulk
    
    # Example of redirecting input from a file
    > wrangler secret:bulk < ./my-file.json
    

Patch Changes

  • #3610 bfbe49d0 Thanks @Skye-31! - Wrangler Capnp Compilation

    This PR replaces logfwdr's schema property with a new unsafe.capnp object. This object accepts either a compiled_schema property, or a base_path and array of source_schemas to get Wrangler to compile the capnp schema for you.

  • #3579 d4450b0a Thanks @rozenmd! - fix: remove --experimental-backend from wrangler d1 migrations apply

    This PR removes the need to pass a --experimental-backend flag when running migrations against an experimental D1 db.

    Closes #3596

  • #3623 99baf58b Thanks @RamIdeas! - when running wrangler init -y ..., the -y flag is now passed to npx when delegating to C3
  • #3668 99032c1e Thanks @rozenmd! - chore: make D1's experimental backend the default

    This PR makes D1's experimental backend turned on by default.

  • #3579 d4450b0a Thanks @rozenmd! - feat: implement time travel for experimental d1 dbs

    This PR adds two commands under wrangler d1 time-travel:

    Use Time Travel to restore, fork or copy a database at a specific point-in-time.
    
    Commands:
    
    wrangler d1 time-travel info <database>     Retrieve information about a database at a specific point-in-time using Time Travel.
    Options:
          --timestamp  accepts a Unix (seconds from epoch) or RFC3339 timestamp (e.g. 2023-07-13T08:46:42.228Z) to retrieve a bookmark for  [string]
          --json       return output as clean JSON  [boolean] [default: false]
    
    wrangler d1 time-travel restore <database>  Restore a database back to a specific point-in-time.
    Options:
          --bookmark   Bookmark to use for time travel  [string]
          --timestamp  accepts a Unix (seconds from epoch) or RFC3339 timestamp (e.g. 2023-07-13T08:46:42.228Z) to retrieve a bookmark for  [string]
          --json       return output as clean JSON  [boolean] [default: false]
    

    Closes #3577

  • #3384 ccc19d57 Thanks @Peter-Sparksuite! - feature: add wrangler deploy option: --old-asset-ttl [seconds]

    wrangler deploy immediately deletes assets that are no longer current, which has a side-effect for existing progressive web app users of seeing 404 errors as the app tries to access assets that no longer exist.

    This new feature:

    • does not change the default behavior of immediately deleting no-longer needed assets.
    • allows users to opt-in to expiring newly obsoleted assets after the provided number of seconds hence, so that current users will have a time buffer before seeing 404 errors.
    • is similar in concept to what was introduced in Wrangler 1.x with https://github.com/cloudflare/wrangler-legacy/pull/2221.
    • is careful to avoid extension of existing expiration targets on already expiring old assets, which may have contributed to unexpectedly large KV storage accumulations (perhaps why, in Wrangler 1.x, the reversion https://github.com/cloudflare/wrangler-legacy/pull/2228 happened).
    • no breaking changes for users relying on the default behavior, but some output changes exist when the new option is used, to indicate the change in behavior.
  • #3678 17780b27 Thanks @1000hz! - Refined the type of CfVars from Record<string, unknown> to Record<string, string | Json>

3.3.0

Minor Changes

Patch Changes

  • #3587 30f114af Thanks @mrbbot! - fix: keep configuration watcher alive

    Ensure wrangler dev watches the wrangler.toml file and reloads the server whenever configuration (e.g. KV namespaces, compatibility dates, etc) changes.

3.2.0

Minor Changes

  • #3426 5a74cb55 Thanks @matthewdavidrodgers! - Prefer non-force deletes unless a Worker is a dependency of another.

    If a Worker is used as a service binding, a durable object namespace, an outbounds for a dynamic dispatch namespace, or a tail consumer, then deleting that Worker will break those existing ones that depend upon it. Deleting with ?force=true allows you to delete anyway, which is currently the default in Wrangler.

    Force deletes are not often necessary, however, and using it as the default has unfortunate consequences in the API. To avoid them, we check if any of those conditions exist, and present the information to the user. If they explicitly acknowledge they're ok with breaking their other Workers, fine, we let them do it. Otherwise, we'll always use the much safer non-force deletes. We also add a "--force" flag to the delete command to skip the checks and confirmation and proceed with ?force=true

Patch Changes

  • #3585 e33bb44a Thanks @mrbbot! - fix: register middleware once for module workers

    Ensure middleware is only registered on the first request when using module workers. This should prevent stack overflows and slowdowns when making large number of requests to wrangler dev with infrequent reloads.

  • #3547 e16d0272 Thanks @jspspike! - Fixed issue with wrangler dev not finding imported files. Previously when wrangler dev would automatically reload on any file changes, it would fail to find any imported files.

3.1.2

Patch Changes

  • #3497 c5f3bf45 Thanks @evanderkoogh! - Refactor dev-only checkedFetch check from a method substitution to a JavaScript Proxy to be able to support Proxied global fetch function.
  • #3403 8d1521e9 Thanks @Cherry! - fix: wrangler generate will now work cross-device. This is very common on Windows install that use C:/ for the OS and another drive for user files.

3.1.1

Patch Changes

  • #3498 fddffdf0 Thanks @GregBrimble! - fix: Prevent wrangler pages dev from serving asset files outside of the build output directory
  • #3414 6b1870ad Thanks @rozenmd! - fix: in D1, lift error.cause into the error message

    Prior to this PR, folks had to console.log the error.cause property to understand why their D1 operations were failing. With this PR, error.cause will continue to work, but we'll also lift the cause into the error message.

  • #3359 5eef992f Thanks @RamIdeas! - wrangler init ... -y now delegates to C3 without prompts (respects the -y flag)
  • #3434 4beac418 Thanks @rozenmd! - fix: add the number of read queries and write queries in the last 24 hours to the d1 info command
  • #3454 a2194043 Thanks @mrbbot! - chore: upgrade miniflare to 3.0.1

    This version ensures root CA certificates are trusted on Windows. It also loads extra certificates from the NODE_EXTRA_CA_CERTS environment variable, allowing wrangler dev to be used with Cloudflare WARP enabled.

  • #3485 e8df68ee Thanks @GregBrimble! - feat: Allow setting a D1 database ID when using wrangler pages dev by providing an optional =<ID> suffix to the argument like --d1 BINDING_NAME=database-id

3.1.0

Minor Changes

Patch Changes

  • #3399 d8a9995b Thanks @Skye-31! - Fix: wrangler pages dev --script-path argument when using a proxy command instead of directory mode

    Fixes a regression in wrangler@3.x, where wrangler pages dev --script-path=<my script path> -- <proxy command> would start throwing esbuild errors.

  • #3314 d5a230f1 Thanks @elithrar! - Fixed wrangler d1 migrations to use --experimental-backend and not --experimentalBackend so that it is consistent with wrangler d1 create.
  • #3373 55703e52 Thanks @rozenmd! - fix: wrangler rollback shouldn't print its warning in the global menu
  • #3124 2956c31d Thanks @verokarhu! - fix: failed d1 migrations not treated as errors

    This PR teaches wrangler to return a non-success exit code when a set of migrations fails.

    It also cleans up wrangler d1 migrations apply output significantly, to only log information relevant to migrations.

  • #3358 27b5aec5 Thanks @rozenmd! - This PR implements a trimmer that removes BEGIN TRANSACTION/COMMIT from SQL files sent to the API (since the D1 API already wraps SQL in a transaction for users).
  • #3324 ed9fbf79 Thanks @rozenmd! - add d1 info command for people to check DB size

    This PR adds a d1 info <NAME> command for getting information about a D1 database, including the current database size and state.

    Usage:

    > npx wrangler d1 info northwind
    
    ┌───────────────────┬──────────────────────────────────────┐
    │                   │ d5b1d127-xxxx-xxxx-xxxx-cbc69f0a9e06 │
    ├───────────────────┼──────────────────────────────────────┤
    │ name              │ northwind                            │
    ├───────────────────┼──────────────────────────────────────┤
    │ version           │ beta                                 │
    ├───────────────────┼──────────────────────────────────────┤
    │ num_tables        │ 13                                   │
    ├───────────────────┼──────────────────────────────────────┤
    │ file_size         │ 33.1 MB                              │
    ├───────────────────┼──────────────────────────────────────┤
    │ running_in_region │ WEUR                                 │
    └───────────────────┴──────────────────────────────────────┘
    
    > npx wrangler d1 info northwind --json
    {
      "uuid": "d5b1d127-xxxx-xxxx-xxxx-cbc69f0a9e06",
      "name": "northwind",
      "version": "beta",
      "num_tables": 13,
      "file_size": 33067008,
      "running_in_region": "WEUR"
    }
    
  • #3317 3dae2585 Thanks @jculvey! - Add the --compatibility-flags and --compatibility-date options to the pages project create command

3.0.1

Patch Changes

3.0.0

Major Changes

  • #3197 3b3fadfa Thanks @mrbbot! - feature: rename wrangler publish to wrangler deploy

    This ensures consistency with other messaging, documentation and our dashboard, which all refer to deployments. This also avoids confusion with the similar but very different npm publish command. wrangler publish will remain a deprecated alias for now, but will be removed in the next major version of Wrangler.

  • #3197 bac9b5de Thanks @mrbbot! - feature: enable local development with Miniflare 3 and workerd by default

    wrangler dev now runs fully-locally by default, using the open-source Cloudflare Workers runtime workerd. To restore the previous behaviour of running on a remote machine with access to production data, use the new --remote flag. The --local and --experimental-local flags have been deprecated, as this behaviour is now the default, and will be removed in the next major version.

  • #3197 02a672ed Thanks @mrbbot! - feature: enable persistent storage in local mode by default

    Wrangler will now persist local KV, R2, D1, Cache and Durable Object data in the .wrangler folder, by default, between reloads. This persistence directory can be customised with the --persist-to flag. The --persist flag has been removed, as this is now the default behaviour.

  • #3197 dc755fdc Thanks @mrbbot! - feature: remove delegation to locally installed versions

    Previously, if Wrangler was installed globally and locally within a project, running the global Wrangler would instead invoke the local version. This behaviour was contrary to most other JavaScript CLI tools and has now been removed. We recommend you use npx wrangler instead, which will invoke the local version if installed, or install globally if not.

  • #3197 24e1607a Thanks @mrbbot! - chore: remove unused files from published package

    Specifically, the src and miniflare-config-stubs directories have been removed.

Minor Changes

  • #3197 e1e5d782 Thanks @mrbbot! - feature: add warning when trying to use wrangler dev inside a WebContainer
  • #3157 4d7781f7 Thanks @edevil! - [wrangler] feat: Support for Constellation bindings

    Added support for a new type of safe bindings called "Constellation" that allows interacting with uploaded models in the context of these projects.

    [[constellation]]
    binding = 'AI'
    project_id = '9d478427-dea6-4988-9b16-f6f8888d974c'
    
  • #3135 cc2adc2e Thanks @edevil! - [wrangler] feat: Support for Browser Workers

    These bindings allow one to use puppeteer to control a browser in a worker script.

Patch Changes

  • #3175 561b962f Thanks @GregBrimble! - fix: _worker.js/ directory support for dynamically imported chunks in wrangler pages dev
  • #3048 6ccc4fa6 Thanks @oustn! - Fix: fix local registry server closed

    Closes #1920. Sometimes start the local dev server will kill the devRegistry server so that the devRegistry server can't be used. We can listen the devRegistry server close event and reset server to null. When registerWorker is called, we can check if the server is null and start a new server.

  • #3001 f9722873 Thanks @rozenmd! - fix: make it possible to create a D1 database backed by the experimental backend, and make d1 execute's batch size configurable

    With this PR, users will be able to run wrangler d1 create <NAME> --experimental-backend to create new D1 dbs that use an experimental backend. You can also run wrangler d1 migrations apply <NAME> experimental-backend to run migrations against an experimental database.

    On top of that, both wrangler d1 migrations apply <NAME> and wrangler d1 execute <NAME> now have a configurable batch-size flag, as the experimental backend can handle more than 10000 statements at a time.

  • #3153 1b67a405 Thanks @edevil! - [wrangler] fix: constellation command help

    Changed name to projectName in some Constellation commands that interacted with projects. Also added the possibility to specify a model description when uploading it.

  • #3168 88ff9d7d Thanks @rozenmd! - feat: (alpha) - make it possible to give D1 a hint on where it should create the database

2.20.0

Minor Changes

  • #3095 133c0423 Thanks @zebp! - feat: add support for placement in wrangler config

    Allows a placement object in the wrangler config with a mode of off or smart to configure Smart placement. Enabling Smart Placement can be done in your wrangler.toml like:

    [placement]
    mode = "smart"
    
  • #3140 5fd080c8 Thanks @penalosa! - feat: Support sourcemaps in DevTools

    Intercept requests from DevTools in Wrangler to inject sourcemaps and enable folders in the Sources Panel of DevTools. When errors are thrown in your Worker, DevTools should now show your source file in the Sources panel, rather than Wrangler's bundled output.

Patch Changes

  • #2912 5079f476 Thanks @petebacondarwin! - fix: do not render "value of stdout.lastframe() is undefined" if the output is an empty string

    Fixes #2907

  • #3133 d0788008 Thanks @dario-piotrowicz! - fix pages building not taking into account the nodejs_compat flag (and improve the related error message)

2.19.0

Minor Changes

2.18.0

Minor Changes

  • #3098 8818f551 Thanks @mrbbot! - fix: improve Workers Sites asset upload reliability
    • Wrangler no longer buffers all assets into memory before uploading. This should prevent out-of-memory errors when publishing sites with many large files.
    • Wrangler now limits the number of in-flight asset upload requests to 5, fixing the Too many bulk operations already in progress error.
    • Wrangler now correctly logs upload progress. Previously, the reported percentage was per upload request group, not across all assets.
    • Wrangler no longer logs all assets to the console by default. Instead, it will just log the first 100. The rest can be shown by setting the WRANGLER_LOG=debug environment variable. A splash of colour has also been added.

2.17.0

Minor Changes

  • #3004 6d5000a7 Thanks @rozenmd! - feat: teach wrangler docs to use algolia search index

    This PR lets you search Cloudflare's entire docs via wrangler docs [search term here].

    By default, if the search fails to find what you're looking for, you'll get an error like this:

    ✘ [ERROR] Could not find docs for: <search term goes here>. Please try again with another search term.
    

    If you provide the --yes or -y flag, wrangler will open the docs to https://developers.cloudflare.com/workers/wrangler/commands/, even if the search fails.

2.16.0

Minor Changes

  • #3058 1bd50f56 Thanks @mrbbot! - chore: upgrade miniflare@3 to 3.0.0-next.13

    Notably, this adds native support for Windows to wrangler dev --experimental-local, logging for incoming requests, and support for a bunch of newer R2 features.

Patch Changes

  • #3058 1bd50f56 Thanks @mrbbot! - fix: disable persistence without --persist in --experimental-local

    This ensures --experimental-local doesn't persist data on the file-system, unless the --persist flag is set. Data is still always persisted between reloads.

  • #3055 5f48c405 Thanks @rozenmd! - fix: Teach D1 commands to read auth configuration from wrangler.toml

    This PR fixes a bug in how D1 handles a user's accounts. We've updated the D1 commands to read from config (typically via wrangler.toml) before trying to run commands. This means if an account_id is defined in config, we'll use that instead of erroring out when there are multiple accounts to pick from.

    Fixes #3046

  • #3058 1bd50f56 Thanks @mrbbot! - fix: disable route validation when using --experimental-local

    This ensures wrangler dev --experimental-local doesn't require a login or an internet connection if a route is configured.

2.15.1

Patch Changes

2.15.0

Minor Changes

  • #2769 0a779904 Thanks @penalosa! - feature: Support modules with --no-bundle

    When the --no-bundle flag is set, Wrangler now has support for uploading additional modules alongside the entrypoint. This will allow modules to be imported at runtime on Cloudflare's Edge. This respects Wrangler's module rules configuration, which means that only imports of non-JS modules will trigger an upload by default. For instance, the following code will now work with --no-bundle (assuming the example.wasm file exists at the correct path):

    // index.js
    import wasm from './example.wasm'
    
    export default {
      async fetch() {
        await WebAssembly.instantiate(wasm, ...)
        ...
      }
    }
    

    For JS modules, it's necessary to specify an additional module rule (or rules) in your wrangler.toml to configure your modules as ES modules or Common JS modules. For instance, to upload additional JavaScript files as ES modules, add the following module rule to your wrangler.toml, which tells Wrangler that all **/*.js files are ES modules.

    rules = [
      { type = "ESModule", globs = ["**/*.js"]},
    ]
    

    If you have Common JS modules, you'd configure Wrangler with a CommonJS rule (the following rule tells Wrangler that all .cjs files are Common JS modules):

    rules = [
      { type = "CommonJS", globs = ["**/*.cjs"]},
    ]
    

    In most projects, adding a single rule will be sufficient. However, for advanced usecases where you're mixing ES modules and Common JS modules, you'll need to use multiple rule definitions. For instance, the following set of rules will match all .mjs files as ES modules, all .cjs files as Common JS modules, and the nested/say-hello.js file as Common JS.

    rules = [
      { type = "CommonJS", globs = ["nested/say-hello.js", "**/*.cjs"]},
      { type = "ESModule", globs = ["**/*.mjs"]}
    ]
    

    If multiple rules overlap, Wrangler will log a warning about the duplicate rules, and will discard additional rules that matches a module. For example, the following rule configuration classifies dep.js as both a Common JS module and an ES module:

    rules = [
      { type = "CommonJS", globs = ["dep.js"]},
      { type = "ESModule", globs = ["dep.js"]}
    ]
    

    Wrangler will treat dep.js as a Common JS module, since that was the first rule that matched, and will log the following warning:

    ▲ [WARNING] Ignoring duplicate module: dep.js (esm)
    

    This also adds a new configuration option to wrangler.toml: base_dir. Defaulting to the directory of your Worker's main entrypoint, this tells Wrangler where your additional modules are located, and determines the module paths against which your module rule globs are matched.

    For instance, given the following directory structure:

    - wrangler.toml
    - src/
      - index.html
      - vendor/
        - dependency.js
      - js/
        - index.js
    

    If your wrangler.toml had main = "src/js/index.js", you would need to set base_dir = "src" in order to be able to import src/vendor/dependency.js and src/index.html from src/js/index.js.

Patch Changes

  • #2957 084b2c58 Thanks @esimons! - fix: Respect querystring params when calling .fetch on a worker instantiated with unstable_dev

    Previously, querystring params would be stripped, causing issues for test cases that depended on them. For example, given the following worker script:

    export default {
      fetch(req) {
        const url = new URL(req.url);
        const name = url.searchParams.get("name");
        return new Response("Hello, " + name);
      },
    };
    

    would fail the following test case:

    const worker = await unstable_dev("script.js");
    const res = await worker.fetch("http://worker?name=Walshy");
    const text = await res.text();
    expect(text).toBe("Hello, Walshy");
    
  • #2840 e311bbbf Thanks @mrbbot! - fix: make WRANGLER_LOG case-insensitive, warn on unexpected values, and fallback to log if invalid

    Previously, levels set via the WRANGLER_LOG environment-variable were case-sensitive. If an unexpected level was set, Wrangler would fallback to none, hiding all logs. The fallback has now been switched to log, and lenient case-insensitive matching is used when setting the level.

  • #2044 eebad0d9 Thanks @kuba-orlik! - fix: allow programmatic dev workers to be stopped and started in a single session
  • #2735 3f7a75cc Thanks @JacobMGEvans! - Fix: Generate Remote URL Previous URL was pointing to the old cloudflare/templates repo, updated the URL to point to templates in the workers-sdk monorepo.

2.14.0

Minor Changes

  • #2914 9af1a640 Thanks @edevil! - feat: add support for send email bindings

    Support send email bindings in order to send emails from a worker. There are three types of bindings:

    • Unrestricted: can send email to any verified destination address.
    • Restricted: can only send email to the supplied destination address (which does not need to be specified when sending the email but also needs to be a verified destination address).
    • Allowlist: can only send email to the supplied list of verified destination addresses.

Patch Changes

  • #2931 5f6c4c0c Thanks @Skye-31! - Fix: Pages Dev incorrectly allowing people to turn off local mode

    Local mode is not currently supported in Pages Dev, and errors when people attempt to use it. Previously, wrangler hid the "toggle local mode" button when using Pages dev, but this got broken somewhere along the line.

2.13.0

Minor Changes

  • #2905 6fd06241 Thanks @edevil! - feat: support external imports from cloudflare:... prefixed modules

    Going forward Workers will be providing built-in modules (similar to node:...) that can be imported using the cloudflare:... prefix. This change adds support to the Wrangler bundler to mark these imports as external.

wrangler deployments view [deployment-id] will get the details of a deployment, including bindings and usage model information. This information can be used to help debug bad deployments.

wrangler rollback [deployment-id] will rollback to a specific deployment in the runtime. This will be useful in situations like recovering from a bad deployment quickly while resolving issues. If a deployment id is not specified wrangler will rollback to the previous deployment. This rollback only changes the code in the runtime and doesn't affect any code or configurations in a developer's local setup.

wrangler deployments list will list the 10 most recent deployments. This command originally existed as wrangler deployments

example of view <deployment-id> output:

Deployment ID: 07d7143d-0284-427e-ba22-2d5e6e91b479
Created on:    2023-03-02T21:05:15.622446Z
Author:        jspspike@gmail.com
Source:        Upload from Wrangler 🤠
------------------------------------------------------------
Author ID:          e5a3ca86e08fb0940d3a05691310bb42
Usage Model:        bundled
Handlers:           fetch
Compatibility Date: 2022-10-03
--------------------------bindings--------------------------
[[r2_buckets]]
binding = "MY_BUCKET"
bucket_name = "testr2"

[[kv_namespaces]]
id = "79300c6d17eb4180a07270f450efe53f"
binding = "yeee"
  • #2859 ace46939 Thanks @jbwcloudflare! - feature: add support for Queue Consumer concurrency

    Consumer concurrency allows a consumer Worker processing messages from a queue to automatically scale out horizontally in order to keep up with the rate that messages are being written to a queue. The new max_concurrency setting can be used to limit the maximum number of concurrent consumer Worker invocations.

Patch Changes

  • #2838 9fa6b167 Thanks @mrbbot! - fix: display cause when local D1 migrations fail to apply

    Previously, if wrangler d1 migrations apply --local failed, you'd see something like:

    ❌ Migration 0000_migration.sql failed with following Errors
    ┌──────────┐
    │ Error    │
    ├──────────┤
    │ D1_ERROR │
    └──────────┘
    

    We'll now show the SQLite error that caused the failure:

    ❌ Migration 0000_migration.sql failed with following Errors
    ┌───────────────────────────────────────────────┐
    │ Error                                         │
    ├───────────────────────────────────────────────┤
    │ Error: SqliteError: unknown database "public" │
    └───────────────────────────────────────────────┘
    

2.12.3

Patch Changes

  • #2884 e33bea9b Thanks @WalshyDev! - Changed console.debug for logger.debug in Pages uploading. This will ensure the debug logs are only sent when debug logging is enabled with WRANGLER_LOG=debug.
  • #2878 6ebb23d5 Thanks @rozenmd! - feat: Add D1 binding support to Email Workers

    This PR makes it possible to query D1 from an Email Worker, assuming a binding has been setup.

    As D1 is in alpha and not considered "production-ready", this changeset is a patch, rather than a minor bump to wrangler.

2.12.2

Patch Changes

2.12.1

Patch Changes

  • #2839 ad4b123b Thanks @mrbbot! - fix: remove vitest from wrangler init's generated tsconfig.json types array

    Previously, wrangler init generated a tsconfig.json with "types": ["@cloudflare/workers-types", "vitest"], even if Vitest tests weren't generated. Unlike Jest, Vitest doesn't provide global APIs by default, so there's no need for ambient types.

  • #2845 e3c036d7 Thanks @Cyb3r-Jak3! - feature: include .wrangler directory in gitignore template used with wrangler init
  • #2806 8d462c0c Thanks @GregBrimble! - feat: Add --outdir as an option when running wrangler pages functions build.

    This deprecates --outfile when building a Pages Plugin with --plugin.

    When building functions normally, --outdir may be used to produce a human-inspectable format of the _worker.bundle that is produced.

  • #2806 8d462c0c Thanks @GregBrimble! - Enable bundling in Pages Functions by default.

    We now enable bundling by default for a functions/ folder and for an _worker.js in Pages Functions. This allows you to use external modules such as Wasm. You can disable this behavior in Direct Upload projects by using the --no-bundle argument in wrangler pages publish and wrangler pages dev.

  • #2836 42fb97e5 Thanks @GregBrimble! - fix: preserve the entrypoint filename when running wrangler publish --outdir <dir>.

    Previously, this entrypoint filename would sometimes be overwritten with some internal filenames. It should now be based off of the entrypoint you provide for your Worker.

  • #2828 891ddf19 Thanks @GregBrimble! - fix: Bring pages dev logging in line with dev proper's

    wrangler pages dev now defaults to logging at the log level (rather than the previous warn level), and the pages prefix is removed.

  • #2855 226e63fa Thanks @GregBrimble! - fix: --experimental-local with wrangler pages dev

    We previously had a bug which logged an error (local worker: TypeError: generateASSETSBinding2 is not a function). This has now been fixed.

  • #2831 2b641765 Thanks @Skye-31! - Fix: Show correct link for how to create an API token in a non-interactive environment

2.12.0

Minor Changes

  • #2810 62784131 Thanks @mrbbot! - chore: upgrade @miniflare/tre to 3.0.0-next.12, incorporating changes from 3.0.0-next.11

    Notably, this brings the following improvements to wrangler dev --experimental-local:

    • Adds support for Durable Objects and D1
    • Fixes an issue blocking clean exits and script reloads
    • Bumps to better-sqlite3@8, allowing installation on Node 19
  • #2665 4756d6a1 Thanks @alankemp! - Add new [unsafe.metadata] section to wrangler.toml allowing arbitary data to be added to the metadata section of the upload

Patch Changes

  • #2539 3725086c Thanks @GregBrimble! - feat: Add support for the nodejs_compat Compatibility Flag when bundling a Worker with Wrangler

    This new Compatibility Flag is incompatible with the legacy --node-compat CLI argument and node_compat configuration option. If you want to use the new runtime Node.js compatibility features, please remove the --node-compat argument from your CLI command or your config file.

2.11.1

Patch Changes

  • #2795 ec3e181e Thanks @penalosa! - fix: Adds a duplex: "half" property to R2 fetch requests with stream bodies in order to be compatible with undici v5.20
  • #2789 4ca8c0b0 Thanks @GregBrimble! - fix: Support overriding the next URL in subsequent executions with next("/new-path") from within a Pages Plugin

2.11.0

Minor Changes

  • #2651 a9adfbe7 Thanks @penalosa! - Previously, wrangler dev would not work if the root of your zone wasn't behind Cloudflare. This behaviour has changed so that now only the route which your Worker is exposed on has to be behind Cloudflare.
  • #2708 b3346cfb Thanks @Skye-31! - Feat: Pages now supports Proxying (200 status) redirects in it's _redirects file

    This will look something like the following, where a request to /users/123 will appear as that in the browser, but will internally go to /users/[id].html.

    /users/:id /users/[id] 200
    

Patch Changes

  • #2766 7912e63a Thanks @mrbbot! - fix: correctly detect service-worker format when using typeof module

    Wrangler automatically detects whether your code is a modules or service-worker format Worker based on the presence of a default export. This check currently works by building your entrypoint with esbuild and looking at the output metafile.

    Previously, we were passing format: "esm" to esbuild when performing this check, which enables format conversion. This may introduce export default into the built code, even if it wasn't there to start with, resulting in incorrect format detections.

    This change removes format: "esm" which disables format conversion when bundling is disabled. See https://esbuild.github.io/api/#format for more details.

  • #2780 80f1187a Thanks @GregBrimble! - fix: Ensure we don't mangle internal constructor names in the wrangler bundle when building with esbuild

    Undici changed how they referenced FormData, which meant that when used in our bundle process, we were failing to upload multipart/form-data bodies. This affected wrangler pages publish and wrangler publish.

  • #2720 de0cb57a Thanks @JacobMGEvans! - Fix: Upgraded to ES2022 for improved compatibility Upgraded worker code target version from ES2020 to ES2022 for better compatibility and unblocking of a workaround related to issue #2029. The worker runtime now uses the same V8 version as recent Chrome and is 99% ES2016+ compliant. The only thing we don't support on the Workers runtime, the remaining 1%, is the ES2022 RegEx feature as seen in the compat table for the latest Chrome version.

    Compatibility table: https://kangax.github.io/compat-table/es2016plus/

    resolves #2716

2.10.0

Minor Changes

  • #2567 02ea098e Thanks @matthewdavidrodgers! - Add mtls-certificate commands and binding support

    Functionality implemented first as an api, which is used in the cli standard api commands

    Note that this adds a new OAuth scope, so OAuth users will need to log out and log back in to use the new 'mtls-certificate' commands However, publishing with mtls-certifcate bindings (bindings of type 'mtls_certificate') will work without the scope.

  • #2717 c5943c9f Thanks @mrbbot! - Upgrade miniflare to 2.12.0, including support for R2 multipart upload bindings, the nodejs_compat compatibility flag, D1 fixes and more!
  • #2579 bf558bdc Thanks @JacobMGEvans! - Added additional fields to the output of wrangler deployments command. The additional fields are from the new value in the response annotations which includes workers/triggered_by and rollback_from

    Example:

    Deployment ID: Galaxy-Class
    Created on:    2021-01-04T00:00:00.000000Z
    
    Trigger:       Upload from Wrangler 🤠
    Rollback from: MOCK-DEPLOYMENT-ID-2222
    

Patch Changes

  • #2624 882bf592 Thanks @CarmenPopoviciu! - Add wasm support in wrangler pages publish

    Currently it is not possible to import wasm modules in either Pages Functions or Pages Advanced Mode projects.

    This commit caries out work to address the aforementioned issue by enabling wasm module imports in wrangler pages publish. As a result, Pages users can now import their wasm modules withing their Functions or _worker.js files, and wrangler pages publish will correctly bundle everything and serve these "external" modules.

  • #2683 68a2a19e Thanks @mrbbot! - Fix internal middleware system to allow D1 databases and --test-scheduled to be used together
  • #2696 4bc78470 Thanks @rozenmd! - fix: don't throw an error when omitting preview_database_id, warn instead
  • #2685 2b1177ad Thanks @CarmenPopoviciu! - You can now import Wasm modules in Pages Functions and Pages Functions Advanced Mode (_worker.js). This change specifically enables wasm module imports in wrangler pages functions build. As a result, Pages users can now import their wasm modules within their Functions or _worker.js files, and wrangler pages functions build will correctly bundle everything and output the expected result file.

2.9.1

Patch Changes

  • #2657 8d21b2ea Thanks @rozenmd! - fix: remove the need to login when running d1 migrations list --local
  • #2592 dd66618b Thanks @rozenmd! - fix: bump esbuild to 0.16.3 (fixes a bug in esbuild's 0.15.13 release that would cause it to hang, is the latest release before a major breaking change that requires us to refactor)

2.9.0

Minor Changes

  • #2629 151733e5 Thanks @mrbbot! - Prefer the workerd exports condition when bundling.

    This can be used to build isomorphic libraries that have different implementations depending on the JavaScript runtime they're running in. When bundling, Wrangler will try to load the workerd key. This is the standard key for the Cloudflare Workers runtime. Learn more about the conditional exports field here.

Patch Changes

  • #2409 89d78c0a Thanks @penalosa! - Wrangler now supports an --experimental-json-config flag which will read your configuration from a wrangler.json file, rather than wrangler.toml. The format of this file is exactly the same as the wrangler.toml configuration file, except that the syntax is JSONC (JSON with comments) rather than TOML. This is experimental, and is not recommended for production use.
  • #2622 9778b33e Thanks @rozenmd! - fix: implement d1 list --json with clean output for piping into other commands

    Before:

    rozenmd@cflaptop test % npx wrangler d1 list
    --------------------
    🚧 D1 is currently in open alpha and is not recommended for production data and traffic
    🚧 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose
    🚧 To request features, visit https://community.cloudflare.com/c/developers/d1
    🚧 To give feedback, visit https://discord.gg/cloudflaredev
    --------------------
    
    ┌──────────────────────────────┬─────────────────┐
    │ uuid                         │ name            │
    ├──────────────────────────────┼─────────────────┤
    │ xxxxxx-xxxx-xxxx-xxxx-xxxxxx │ test            │
    ├──────────────────────────────┼─────────────────┤
    │ xxxxxx-xxxx-xxxx-xxxx-xxxxxx │ test2           │
    ├──────────────────────────────┼─────────────────┤
    │ xxxxxx-xxxx-xxxx-xxxx-xxxxxx │ test3           │
    └──────────────────────────────┴─────────────────┘
    

    After:

    rozenmd@cflaptop test % npx wrangler d1 list --json
    [
      {
        "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
        "name": "test"
      },
      {
        "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
        "name": "test2"
      },
      {
        "uuid": "xxxxxx-xxxx-xxxx-xxxx-xxxxxx",
        "name": "test3"
      },
    ]
    
  • #2631 6b3fe5ef Thanks @thibmeu! - Fix wrangler publish --dry-run to not require authentication when using Queues
  • #2627 6f0f2ba6 Thanks @rozenmd! - fix: implement d1 execute --json with clean output for piping into other commands

    Before:

    rozenmd@cflaptop test1 % npx wrangler d1 execute test --command="select * from customers"[WARNING] Processing wrangler.toml configuration:
    
        - D1 Bindings are currently in alpha to allow the API to evolve before general availability.
          Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose
          Note: Run this command with the environment variable NO_D1_WARNING=true to hide this message
    
          For example: `export NO_D1_WARNING=true && wrangler <YOUR COMMAND HERE>`
    
    --------------------
    🚧 D1 is currently in open alpha and is not recommended for production data and traffic
    🚧 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose
    🚧 To request features, visit https://community.cloudflare.com/c/developers/d1
    🚧 To give feedback, visit https://discord.gg/cloudflaredev
    --------------------
    
    🌀 Mapping SQL input into an array of statements
    🌀 Parsing 1 statements
    🌀 Executing on test (xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx):
    🚣 Executed 1 command in 11.846710999961942ms
    ┌────────────┬─────────────────────┬───────────────────┐
    │ CustomerID │ CompanyName         │ ContactName       │
    ├────────────┼─────────────────────┼───────────────────┤
    │ 1          │ Alfreds Futterkiste │ Maria Anders      │
    ├────────────┼─────────────────────┼───────────────────┤
    │ 4          │ Around the Horn     │ Thomas Hardy      │
    ├────────────┼─────────────────────┼───────────────────┤
    │ 11         │ Bs Beverages        │ Victoria Ashworth │
    ├────────────┼─────────────────────┼───────────────────┤
    │ 13         │ Bs Beverages        │ Random Name       │
    └────────────┴─────────────────────┴───────────────────┘
    

After:

rozenmd@cflaptop test1 % npx wrangler d1 execute test --command="select * from customers" --json
[
  {
    "results": [
      {
        "CustomerID": 1,
        "CompanyName": "Alfreds Futterkiste",
        "ContactName": "Maria Anders"
      },
      {
        "CustomerID": 4,
        "CompanyName": "Around the Horn",
        "ContactName": "Thomas Hardy"
      },
      {
        "CustomerID": 11,
        "CompanyName": "Bs Beverages",
        "ContactName": "Victoria Ashworth"
      },
      {
        "CustomerID": 13,
        "CompanyName": "Bs Beverages",
        "ContactName": "Random Name"
      }
    ],
    "success": true,
    "meta": {
      "duration": 1.662519000004977,
      "last_row_id": null,
      "changes": null,
      "served_by": "primary-xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.db3",
      "internal_stats": null
    }
  }
]

2.8.1

Patch Changes

  • #2501 a0e5a491 Thanks @geelen! - fix: make it possible to query d1 databases from durable objects

    This PR makes it possible to access D1 from Durable Objects.

    To be able to query D1 from your Durable Object, you'll need to install the latest version of wrangler, and redeploy your Worker.

    For a D1 binding like:

    [[d1_databases]]
    binding = "DB" # i.e. available in your Worker on env.DB
    database_name = "my-database-name"
    database_id = "UUID-GOES-HERE"
    preview_database_id = "UUID-GOES-HERE"
    

    You'll be able to access your D1 database via env.DB in your Durable Object.

  • #2280 ef110923 Thanks @penalosa! - Support queue and trace events in module middleware. This means that queue and trace events should work properly with the --test-scheduled flag
  • #2554 fbeaf609 Thanks @CarmenPopoviciu! - feat: Add support for wasm module imports in wrangler pages dev

    Currently it is not possible to import wasm modules in either Pages Functions or Pages Advanced Mode projects.

    This commit caries out work to address the aforementioned issue by enabling wasm module imports in wrangler pages dev. As a result, Pages users can now import their wasm modules withing their Functions or _worker.js files, and wrangler pages dev will correctly bundle everything and serve these "external" modules.

    import hello from "./hello.wasm"
    
    export async function onRequest() {
    	const module = await WebAssembly.instantiate(hello);
    	return new Response(module.exports.hello);
    }
    
  • #2563 5ba39569 Thanks @CarmenPopoviciu! - fix: Copy module imports related files to outdir

    When we bundle a Worker esbuild takes care of writing the results to the output directory. However, if the Worker contains any external imports, such as text/wasm/binary module imports, that cannot be inlined into the same bundle file, bundleWorker will not copy these files to the output directory. This doesn't affect wrangler publish per se, because of how the Worker upload FormData is created. It does however create some inconsistencies when running wrangler publish --outdir or wrangler publish --outdir --dry-run, in that, outdir will not contain those external import files.

    This commit addresses this issue by making sure the aforementioned files do get copied over to outdir together with esbuild's resulting bundle files.

2.8.0

Minor Changes

  • #2404 3f824347 Thanks @petebacondarwin! - feat: support bundling the raw Pages _worker.js before deploying

    Previously, if you provided a _worker.js file, then Pages would simply check the file for disallowed imports and then deploy the file as-is.

    Not bundling the _worker.js file means that it cannot containing imports to other JS files, but also prevents Wrangler from adding shims such as the one for the D1 alpha release.

    This change adds the ability to tell Wrangler to pass the _worker.js through the normal Wrangler bundling process before deploying by setting the --bundle command line argument to wrangler pages dev and wrangler pages publish.

    This is in keeping with the same flag for wrangler publish.

    Currently bundling is opt-in, flag defaults to false if not provided.

Patch Changes

  • #2551 bfffe595 Thanks @rozenmd! - fix: wrangler init --from-dash incorrectly expects index.ts while writing index.js

    This PR fixes a bug where Wrangler would write a wrangler.toml expecting an index.ts file, while writing an index.js file.

  • #2529 2270507c Thanks @CarmenPopoviciu! - Remove "experimental _routes.json" warnings

    _routes.json is no longer considered an experimental feature, so let's remove all warnings we have in place for that.

  • #2548 4db768fa Thanks @rozenmd! - fix: path should be optional for wrangler d1 backup download

    This PR fixes a bug that forces folks to provide a --output flag to wrangler d1 backup download.

  • #2528 18208091 Thanks @caass! - Add some guidance when folks encounter a 10021 error.

    Error code 10021 can occur when your worker doesn't pass startup validation. This error message will make it a little easier to reason about what happened and what to do next.

    Closes #2519

2.7.1

Patch Changes

  • #2523 a5e9958c Thanks @jahands! - fix: unstable_dev() experimental options incorrectly applying defaults

    A subtle difference when removing object-spreading of experimental unstable_dev() options caused wrangler pages dev interactivity to stop working. This switches back to object-spreading the passed in options on top of the defaults, fixing the issue.

2.7.0

Minor Changes

  • #2465 e1c2f5b9 Thanks @JacobMGEvans! - After this PR, wrangler init --yes will generate a test for your new Worker project, using Vitest with TypeScript. When using wrangler init, and choosing to create a Typescript project, you will now be asked if Wrangler should write tests for you, using Vitest.

    This resolves issue #2436.

Patch Changes

  • #2460 c2b2dfb8 Thanks @rozenmd! - fix: resolve unstable_dev flakiness in tests by awaiting the dev registry
  • #2439 616f8739 Thanks @petebacondarwin! - fix(wrangler): do not login or read wrangler.toml when applying D1 migrations in local mode.

    When applying D1 migrations to a deployed database, it is important that we are logged in and that we have the database ID from the wrangler.toml. This is not needed for --local mode where we are just writing to a local SQLite file.

  • #1869 917b07b0 Thanks @petebacondarwin! - feat: enable Wrangler to target the staging API by setting WRANGLER_API_ENVIRONMENT=staging

    If you are developing Wrangler, or an internal Cloudflare feature, and during testing, need Wrangler to target the staging API rather than production, it is now possible by setting the WRANGLER_API_ENVIRONMENT environment variable to staging.

    This will update all the necessary OAuth and API URLs, update the OAuth client ID, and also (if necessary) acquire an Access token for to get through the firewall to the staging URLs.

  • #2377 32686e42 Thanks @mrbbot! - Fix ReferenceError when using wrangler dev --experimental-local in Node 16
  • #2485 4c0e2309 Thanks @GregBrimble! - fix: Pages Plugin routing when mounted at the root of a project

    Previously, there was a bug which meant that Plugins mounted at the root of a Pages project were not correctly matching incoming requests. This change fixes that bug so Plugins mounted at the root should now correctly work.

  • #2479 7b479b91 Thanks @rozenmd! - fix: bump d1js

    This PR bumps d1js, adding the following functionality to the d1 alpha shim:

    • validates supported types
    • converts ArrayBuffer to array
    • converts typedArray to array
  • #2391 19525a4b Thanks @mrbbot! - Always log when delegating to local wrangler install.

    When a global wrangler command is executed in a package directory with wrangler installed locally, the command is redirected to the local wrangler install. We now always log a message when this happens, so you know what's going on.

  • #2468 97282459 Thanks @rozenmd! - BREAKING CHANGE: move experimental options under the experimental object for unstable_dev
  • #2495 e93063e9 Thanks @petebacondarwin! - fix(d1): ensure that migrations support compound statements

    This fix updates the SQL statement splitting so that it does not split in the middle of compound statements. Previously we were using a third party splitting library, but this needed fixing and was actually unnecessary for our purposes. So a new splitter has been implemented and the library dependency removed. Also the error handling in d1 migrations apply has been improved to handle a wider range of error types.

    Fixes #2463

  • #2400 08a0b22e Thanks @mrbbot! - Cleanly exit wrangler dev --experimental-local when pressing x/q/CTRL-C
  • #2374 ecba1ede Thanks @rozenmd! - fix: make --from-dash error output clearer

    This PR makes it clearer what --from-dash wants from you.

    closes #2373 closes #2375

  • #2377 32686e42 Thanks @mrbbot! - Respect FORCE_COLOR=0 environment variable to disable colored output when using wrangler dev --local
  • #2455 d9c1d273 Thanks @rozenmd! - BREAKING CHANGE: refactor unstable_dev to use an experimental object, instead of a second options object

    Before, if you wanted to disable the experimental warning, you would run:

    worker = await unstable_dev(
      "src/index.js",
      {},
      { disableExperimentalWarning: true }
    );
    

    After this change, you'll need to do this instead:

    worker = await unstable_dev("src/index.js", {
      experimental: { disableExperimentalWarning: true },
    });
    

2.6.2

Patch Changes

  • #2341 5afa13ec Thanks @rozenmd! - fix: d1 - don't backup prod db when applying migrations locally

    Closes #2336

2.6.1

Patch Changes

  • #2339 f6821189 Thanks @GregBrimble! - fix: wrangler dev --local now correctly lazy-imports @miniflare/tre

    Previously, we introduced a bug where we were incorrectly requiring @miniflare/tre, even when not using the workerd/--experimental-local mode.

2.6.0

Minor Changes

  • #2268 3be1c2cf Thanks @GregBrimble! - feat: Add support for --experimental-local to wrangler pages dev which will use the workerd runtime.

    Add @miniflare/tre environment polyfill to @cloudflare/pages-shared.

  • #2163 d73a34be Thanks @jimhawkridge! - feat: Add support for Analytics Engine bindings.

    For example:

    analytics_engine_datasets = [
        { binding = "ANALYTICS", dataset = "my_dataset" }
    ]
    

Patch Changes

  • #2177 e98613f8 Thanks @caass! - Trigger login flow if a user runs wrangler dev while logged out

    Previously, we would just error if a user logged out and then ran wrangler dev. Now, we kick them to the OAuth flow and suggest running wrangler dev --local if the login fails.

    Closes #2147

  • #2298 bb5e4f91 Thanks @rozenmd! - fix: d1 not using the preview database when using wrangler dev

    After this fix, wrangler will correctly connect to the preview database, rather than the prod database when using wrangler dev

  • #2176 d48ee112 Thanks @caass! - Use the user's preferred default branch name if set in .gitconfig.

    Previously, we would initialize new workers with main as the name of the default branch. Now, we see if the user has a custom setting in .gitconfig for init.defaultBranch, and use that if it exists.

    Closes #2112

  • #2275 bbfb6a96 Thanks @mrbbot! - Fix script reloads, and allow clean exits, when using --experimental-local on Linux

2.5.0

Minor Changes

Patch Changes

  • #2296 7da8f0e6 Thanks @Skye-31! - Fix: check response status of d1 backup download command before writing contents to file
  • #2260 c2940160 Thanks @rozenmd! - fix: make it possible to use a local db for d1 migrations

    As of this change, wrangler's d1 migrations commands now accept local and persist-to as flags, so migrations can run against the local d1 db.

2.4.4

Patch Changes

2.4.3

Patch Changes

  • #2249 e41c7e41 Thanks @mrbbot! - Enable pretty source-mapped error pages when using --experimental-local
  • #2248 effc2215 Thanks @rozenmd! - chore: remove d1 local hardcoding

    Prior to this change wrangler would only ever use local mode when testing d1.

    After this change d1 tests can access both local and remote Workers.

  • #2254 9e296a4d Thanks @penalosa! - Add an option to customise whether wrangler login opens a browser automatically. Use wrangler login --no-browser to prevent a browser being open—the link will be printed to the console so it can be manually opened.

2.4.2

Patch Changes

2.4.1

Patch Changes

2.4.0

Minor Changes

  • #2193 0047ad30 Thanks @JacobMGEvans! - Local Mode Console Support Added support for detailed console.log capability when using --experimental-local

    resolves #2122

Patch Changes

  • #2192 add4278a Thanks @mrbbot! - Add a --experimental-local-remote-kv flag to enable reading/writing from/to real KV namespaces. Note this flag requires --experimental-local to be enabled.
  • #2204 c725ce01 Thanks @jahands! - fix: Upload filepath-routing configuration in wrangler pages publish

    Publishing Pages projects containing a functions directory incorrectly did not upload the filepath-routing config so that the user can view it in Dash. This fixes that, making the generated routes viewable under Routing configuration in the Functions tab of a deployment.

2.3.2

Patch Changes

2.3.1

Patch Changes

2.3.0

Minor Changes

Patch Changes

  • #2178 d165b741 Thanks @JacobMGEvans! - [feat] Queues generated type: Added the ability to generate manual types for Queues from Wrangler configuration.

2.2.3

Patch Changes

  • #2138 2be9d642 Thanks @mrbbot! - Reduce script reload times when using wrangler dev --experimental-local

2.2.2

Patch Changes

  • #2161 dff756f3 Thanks @jbw1991! - Check for the correct API error code when attempting to detect missing Queues.
  • #2165 a26f74ba Thanks @JacobMGEvans! - Fix Var string type: The type was not being coerced to a string, so TypeScript considered it a unresolved type.

2.2.1

Patch Changes

  • #2067 758419ed Thanks @Skye-31! - fix: Accurately determine when using imports in _worker.js for Advanced Mode Pages Functions
  • #2159 c5a7557f Thanks @rozenmd! - fix: silence the 10023 error that throws when deployments isn't fully rolled out

2.2.0

Minor Changes

  • #2107 511943e9 Thanks @celso! - fix: D1 execute and backup commands improvements
    • Better and faster handling when importing big SQL files using execute --file
    • Increased visibility during imports, sends output with each batch API call
    • Backups are now downloaded to the directory where wrangler was initiated from
  • #2130 68f4fa6f Thanks @matthewdavidrodgers! - feature: Add warnings around bundle sizes for large scripts

    Prints a warning for scripts > 1MB compressed, encouraging smaller script sizes. This warning can be silenced by setting the NO_SCRIPT_SIZE_WARNING env variable

    If a publish fails with either a script size error or a validator error on script startup (CPU or memory), we print out the largest 5 dependencies in your bundle. This is accomplished by using the esbuild generated metafile.

  • #2064 49b6a484 Thanks @jbw1991! - Adds support for Cloudflare Queues. Adds new CLI commands to configure Queues. Queue producers and consumers can be defined in wrangler.toml.
  • #1982 5640fe88 Thanks @penalosa! - Enable support for wrangler dev on Workers behind Cloudflare Access, utilising cloudflared. If you don't have cloudflared installed, Wrangler will prompt you to install it. If you do, then the first time you start developing using wrangler dev your default browser will open with a Cloudflare Access prompt.

Patch Changes

  • #2127 0e561e83 Thanks @JacobMGEvans! - Fix: Missing Worker name using --from-dash Added the --from-dash name as a fallback when no name is provided in the wrangler init command. Additionally added a checks to the std.out to ensure that the name is provided.

    resolves #1853

  • #2073 1987a79d Thanks @mrbbot! - If --env <env> is specified, we'll now check .env.<env>/.dev.vars.<env> first. If they don't exist, we'll fallback to .env/.dev.vars.
  • #2072 06aa6121 Thanks @mrbbot! - Fixed importing installed npm packages with the same name as Node built-in modules if node_compat is disabled.
  • #2124 02ca556c Thanks @JacobMGEvans! - Computing the name from binding response Now the vars will be computed, example: [var.binding.name]: var.binding.text

    this will resolve the issue that was occurring with generating a TOML with incorrect fields for the vars key/value pair.

    resolves #2048

2.1.15

Patch Changes

  • #2103 f1fd62a1 Thanks @GregBrimble! - fix: Don't upload functions/ directory as part of wrangler pages publish

    If the root directory of a project was the same as the build output directory, we were previously uploading the functions/ directory as static assets. This PR now ensures that the functions/ files are only used to create Pages Functions and are no longer uploaded as static assets.

    Additionally, we also now do upload _worker.js, _headers, _redirects and _routes.json if they aren't immediate children of the build output directory. Previously, we'd ignore all files with this name regardless of location. For example, if you have a public/blog/how-to-use-pages/_headers file (where public is your build output directory), we will now upload the _headers file as a static asset.

  • #2111 ab52f771 Thanks @GregBrimble! - feat: Add a passThroughOnException() handler in Pages Functions

    This passThroughOnException() handler is not as good as the built-in for Workers. We're just adding it now as a stop-gap until we can do the behind-the-scenes plumbing required to make the built-in function work properly.

    We wrap your Pages Functions code in a try/catch and on failure, if you call passThroughOnException() we defer to the static assets of your project.

    For example:

    export const onRequest = ({ passThroughOnException }) => {
      passThroughOnException();
    
      x; // Would ordinarily throw an error, but instead, static assets are served.
    };
    

2.1.14

Patch Changes

  • #2074 b08ab1e5 Thanks @JacobMGEvans! - The type command aggregates bindings and custom module rules from config, then generates a DTS file for both service workers' declare global { ... } or module workers' interface Env { ... }

    Custom module rules generate declare modules based on the module type (Text, Data or CompiledWasm). Module Example Outputs:

    CompiledWasm

    declare module "**/*.wasm" {
      const value: WebAssembly.Module;
      export default value;
    }
    

    Data

    declare module "**/*.webp" {
      const value: ArrayBuffer;
      export default value;
    }
    

    Text

    declare module "**/*.text" {
      const value: string;
      export default value;
    }
    

    resolves #2034 resolves #2033

  • #2065 14c44588 Thanks @CarmenPopoviciu! - fix(pages): wrangler pages dev matches routing rules in _routes.json too loosely

    Currently, the logic by which we transform routing rules in _routes.json to regular expressions, so we can perform pathname matching & routing when we run wrangler pages dev, is too permissive, and leads to serving incorrect assets for certain url paths.

    For example, a routing rule such as /foo will incorrectly match pathname /bar/foo. Similarly, pathname /foo will be incorrectly matched by the / routing rule. This commit fixes our routing rule to pathname matching logic and brings wrangler pages dev on par with routing in deployed Pages projects.

  • #2098 2a81caee Thanks @threepointone! - feat: delete site/assets namespace when a worker is deleted

    This patch deletes any site/asset kv namespaces associated with a worker when wrangler delete is used. It finds the namespace associated with a worker by using the names it would have otherwise used, and deletes it. It also does the same for the preview namespace that's used with wrangler dev.

  • #2091 9491d86f Thanks @JacobMGEvans! - Wrangler deployments command Added support for the deployments command, which allows you to list the last ten deployments for a given script.

    The information will include:

    • Version ID
    • Version number
    • Author email
    • Latest deploy
    • Created on

    resolves #2089

  • #2068 2c1fd9d2 Thanks @mrbbot! - Fixed issue where information and warning messages from Miniflare were being discarded when using wrangler dev --local. Logs from Miniflare will now be coloured too, if the terminal supports this.

2.1.13

Patch Changes

  • #2035 76a66fc2 Thanks @penalosa! - Warn when opening a tail on workers for which a restart could be disruptive (i.e. Workers which use Durable Objects in conjunction with WebSockets)
  • #2045 c2d3286f Thanks @threepointone! - feat: implement a basic wrangler delete

    This PR adds a simple (but useful!) implementation for wrangler delete. Of note, it'll delete a given service, including all it's bindings. It uses the same api as the dashboard.

2.1.12

Patch Changes

  • #2023 d6660ce3 Thanks @caass! - Display a more helpful error when trying to publish to a route in use by another worker.

    Previously, when trying to publish a worker to a route that was in use by another worker, there would be a really unhelpful message about a failed API call. Now, there's a much nicer message that tells you what worker is running on that route, and gives you a link to the workers overview page so you can unassign it if you want.

     ⛅️ wrangler 2.1.11
    --------------------
    Total Upload: 0.20 KiB / gzip: 0.17 KiB
    
    ✘ [ERROR] Can't publish a worker to routes that are assigned to another worker.
    
      "test-custom-routes-redeploy" is already assigned to route
      test-custom-worker.swag.lgbt
    
      Unassign other workers from the routes you want to publish to, and then try again.
      Visit
      https://dash.cloudflare.com/<account_id>/workers/overview
      to unassign a worker from a route.
    

    Closes #1849

  • #2013 c63ca0a5 Thanks @rozenmd! - fix: make d1 help print if a command is incomplete

    Prior to this change, d1's commands would return silently if wrangler wasn't supplied enough arguments to run the command.

    This change resolves this issue, and ensures help is always printed if the command couldn't run.

  • #2016 932fecc0 Thanks @caass! - Offer to create a workers.dev subdomain if a user needs one

    Previously, when a user wanted to publish a worker to https://workers.dev by setting workers_dev = true in their wrangler.toml, but their account didn't have a subdomain registered, we would error out.

    Now, we offer to create one for them. It's not implemented for wrangler dev, which also expects you to have registered a workers.dev subdomain, but we now error correctly and tell them what the problem is.

  • #2024 4ad48e4d Thanks @rozenmd! - fix: make it possible for values in vars and defines to have colons (:)

    Prior to this change, passing --define someKey:https://some-value.com would result in an incomplete value being passed to the Worker.

    This change correctly handles colons for var and define in wrangler dev and wrangler publish.

  • #2032 f33805d2 Thanks @caass! - Catch unsupported terminal errors and provide a nicer error message.

    Wrangler depends on terminals supporting raw mode. Previously, attempting to run wrangler from a terminal that didn't support raw mode would result in an Ink error, which was both an exposure of an internal implementation detail to the user and also not actionable:

      ERROR Raw mode is not supported on the current process.stdin, which Ink uses
           as input stream by default.
           Read about how to prevent this error on
           https://github.com/vadimdemedes/ink/#israwmodesupported
    

    Now, we provide a much nicer error, which provides an easy next step for th user:

    
    ERROR: This terminal doesn't support raw mode.
    
    Wrangler uses raw mode to read user input and write output to the terminal, and won't function correctly without it.
    
    Try running your previous command in a terminal that supports raw mode, such as Command Prompt or Powershell.
    

    Closes #1992

  • #1946 7716c3b9 Thanks @penalosa! - Support subdomains with wrangler dev for routes defined with zone_name (instead of just for routes defined with zone_id)

2.1.11

Patch Changes

  • #1957 b579c2b5 Thanks @caass! - Remove dependency on create-cloudflare.

    Previously, wrangler generate was a thin wrapper around create-cloudflare. Now, we've moved over the logic from that package directly into wrangler.

  • #1950 daf73fbe Thanks @CarmenPopoviciu! - wrangler pages dev should prioritize _worker.js

    When using a _worker.js file, the entire /functions directory should be ignored this includes its routing and middleware characteristics. Currently wrangler pages dev does the reverse, by prioritizing /functions over _worker.js. These changes fix the current behaviour.

  • #1928 c1722170 Thanks @GregBrimble! - fix: Allow unsetting of automatically generated Link headers using _headers and the ! Link operator
  • #1928 c1722170 Thanks @GregBrimble! - fix: Only generate Link headers from simple <link> elements.

    Specifically, only those with the rel, href and possibly as attributes. Any element with additional attributes will not be used to generate headers.

  • #1965 9709d3a3 Thanks @JacobMGEvans! - chore: remove hidden on --from-dash The --from-dash can now be used with the dashboard features to support moving Worker developmment to a local machine.

    resolves #1783

  • #1978 6006ae50 Thanks @JacobMGEvans! - chore: Undici 5.11.0 multipart/form-data support The 5.11.0 version of Undici now supports multipart/form-data previously needed a ponyfill we can now handle the multipart/form-data without any custom code.

    resolves #1977

2.1.10

Patch Changes

  • #1955 b6dd07a1 Thanks @cameron-robey! - chore: error if d1 bindings used with no-bundle

    While in beta, you cannot use D1 bindings without bundling your worker as these are added in through a facade which gets bypassed when using the no-bundle option.

  • #1964 1f50578e Thanks @JacobMGEvans! - chore: Emoji space in help description Added a space between the Emoji and description for the secret:bulk command.
  • #1967 02261f27 Thanks @rozenmd! - feat: implement remote mode for unstable_dev

    With this change, unstable_dev can now perform end-to-end (e2e) tests against your workers as you dev.

    Note that to use this feature in CI, you'll need to configure CLOUDFLARE_API_TOKEN as an environment variable in your CI, and potentially add CLOUDFLARE_ACCOUNT_ID as an environment variable in your CI, or account_id in your wrangler.toml.

    Usage:

    await unstable_dev("src/index.ts", {
      local: false,
    });
    

2.1.9

Patch Changes

  • #1937 905fce4f Thanks @JacobMGEvans! - fix: fails to publish due to empty migrations After this change, wrangler init --from-dash will not attempt to add durable object migrations to wrangler.toml for Workers that don't have durable objects.

    fixes #1854

  • #1943 58a430f2 Thanks @cameron-robey! - chore: add env and ctx params to fetch in javascript example template

    Just like in the typescript templates, and the javascript template for scheduled workers, we include env and ctx as parameters to the fetch export. This makes it clearer where environment variables live.

  • #1939 5854cb69 Thanks @rozenmd! - fix: respect variable binding type when printing

    After this change, when printing the bindings it has access to, wrangler will correctly only add quotes around string variables, and serialize objects via JSON.stringify (rather than printing "[object Object]").

  • #1930 56798155 Thanks @rozenmd! - fix: use node http instead of faye-websocket in proxy server

    We change how websockets are handled in the proxy server, fixing multiple issues of websocket behaviour, particularly to do with headers.

    In particular this fixes:

    • the protocol passed between the client and the worker was being stripped out by wrangler
    • wrangler was discarding additional headesr from websocket upgrade response
    • websocket close code and reason was not being propagated by wrangler

2.1.8

Patch Changes

  • #1894 ed646cf9 Thanks @mrbbot! - Add experimental support for using the open-source Workers runtime workerd in wrangler dev. Use wrangler dev --experimental-local to try it out! 🚀 Note this feature is still under active development.

2.1.7

Patch Changes

  • #1881 6ff5a030 Thanks @Skye-31! - Chore: correctly log all listening ports on remote mode (closes #1652)
  • #1913 9f7cc5a0 Thanks @threepointone! - feat: expose port and address on (Unstable)DevWorker

    when using unstable_dev(), I think we want to expose the port/address that the server has started on. The usecase is when trying to connect to the server without calling .fetch() (example: when making a websocket connection).

  • #1911 16c28502 Thanks @rozenmd! - fix: put config cache log behind logger.debug

    Prior to this change, wrangler would print Retrieving cached values for... after almost every single command.

    After this change, you'll only see this message if you add WRANGLER_LOG=debug before your command.

    Closes #1808

2.1.6

Patch Changes

  • #1895 1b53bf9d Thanks @rozenmd! - fix: rename keep_bindings to keep_vars, and make it opt-in, to keep wrangler.toml compatible with being used for Infrastructure as Code

    By default, wrangler.toml is the source of truth for your environment configuration, like a terraform file.

    If you change your settings (particularly your vars) in the dashboard, wrangler will override them. If you want to disable this behavior, set this field to true.

    Between wrangler 2.0.28 and 2.1.5, by default wrangler would not delete your vars by default, breaking expected wrangler.toml behaviour.

  • #1889 98f756c7 Thanks @penalosa! - fix: Correctly place the .wrangler/state local state directory in the same directory as wrangler.toml by default
  • #1886 8b647175 Thanks @JacobMGEvans! - fix: potential missing compatibility_date in wrangler.toml when running wrangler init --from-dash Fixed a bug where compatibility_date wasn't being added to wrangler.toml when initializing a worker via wrangler init --from-dash

    fixes #1855

2.1.5

Patch Changes

  • #1801 07fc90d6 Thanks @rozenmd! - feat: multi-worker testing

    This change introduces the ability to test multi-worker setups via the wrangler API's unstable_dev function.

    Usage:

    import { unstable_dev } from "wrangler";
    
    describe("multi-worker testing", () => {
      let childWorker;
      let parentWorker;
    
      beforeAll(async () => {
        childWorker = await unstable_dev(
          "src/child-worker.js",
          { config: "src/child-wrangler.toml" },
          { disableExperimentalWarning: true }
        );
        parentWorker = await unstable_dev(
          "src/parent-worker.js",
          { config: "src/parent-wrangler.toml" },
          { disableExperimentalWarning: true }
        );
      });
    
      afterAll(async () => {
        await childWorker.stop();
        await parentWorker.stop();
      });
    
      it("childWorker should return Hello World itself", async () => {
        const resp = await childWorker.fetch();
        if (resp) {
          const text = await resp.text();
          expect(text).toMatchInlineSnapshot(`"Hello World!"`);
        }
      });
    
      it("parentWorker should return Hello World by invoking the child worker", async () => {
        const resp = await parentWorker.fetch();
        if (resp) {
          const parsedResp = await resp.text();
          expect(parsedResp).toEqual("Parent worker sees: Hello World!");
        }
      });
    });
    
  • #1865 adfc52d6 Thanks @JacobMGEvans! - polish: loglevel flag Added a '--log-level' flag that allows the user to specify between 'debug', 'info', 'log', 'warning', 'error', 'none' Currently 'none' will turn off all outputs in Miniflare (local mode), however, Wrangler will still output Errors.

    resolves #185

2.1.4

Patch Changes

  • #1839 2660872a Thanks @cameron-robey! - feat: make it possible to specify a path for unstable_dev()'s fetch method

    const worker = await unstable_dev(
      "script.js"
    );
    const res = await worker.fetch(req);
    

    where req can be anything from RequestInfo: string | URL | Request.

  • #1851 afca1b6c Thanks @cameron-robey! - feat: summary output for secret:bulk

    When wrangler secret:bulk <json> is run, a summary is outputted at the end with the number of secrets successfully / unsuccessfully created.

  • #1846 f450e387 Thanks @rozenmd! - fix: when running wrangler init, add a test script to package.json when the user asks us to write their first test

2.1.3

Patch Changes

  • #1836 3583f313 Thanks @rozenmd! - fix: wrangler publish for CI after a manual deployment

    Prior to this change, if you edited your Worker via the Cloudflare Dashboard, then used CI to deploy your script, wrangler publish would fail.

    This change logs a warning that your manual changes are going to be overriden, but doesn't require user input to proceed.

    Closes #1832

  • #1644 dc1c9595 Thanks @geelen! - Deprecated --experimental-enable-local-persistence.

    Added --persist and --persist-to in its place. Changed the default persistence directory to .wrangler/state, relative to wrangler.toml.

    To migrate to the new flag, run mkdir -p .wrangler && mv wrangler-local-state .wrangler/state then use --persist. Alternatively, you can use --persist-to=./wrangler-local-state to keep using the files in the old location.

2.1.2

Patch Changes

2.1.1

Patch Changes

  • #1827 32a58fee Thanks @JacobMGEvans! - fix: Publish error when deploying new Workers

    This fix adds a try/catch when checking when the Worker was last deployed.

    The check was failing when a Worker had never been deployed, causing deployments of new Workers to fail.

    fixes #1824

  • #1799 a89786ba Thanks @JacobMGEvans! - feat: Bulk Secret Upload Created a flag that allows for passing in a JSON file with key/value's of secrets.

    resolve #1610

2.1.0

Minor Changes

  • #1713 82451e9d Thanks @jspspike! - Tail now uses updated endpoint. Allows tailing workers that are above the normal "invocations per second" limit when using the --ip self filter.

Patch Changes

  • #1782 cc43e3c4 Thanks @jahands! - fix: Update Pages test to assert version in package.json

    This test was asserting a hardcoded wrangler version which broke after release.

  • #1786 1af49b68 Thanks @rozenmd! - fix: refactor unstable_dev to avoid race conditions with ports

    Prior to this change, wrangler would check to see if a port was available, do a bit more work, then try use that port when starting miniflare. With this change, we're using port 0 to tell Node to assign us a random free port.

    To make this change work, we had to do some plumbing so miniflare can tell us the host and port it's using, so we can call fetch against it.

  • #1788 152a1e81 Thanks @GregBrimble! - chore: Refactor 'wrangler pages dev' to use the same code as we do in production

    This will make our dev implementation an even closer simulation of production, and will make maintenance easier going forward.

  • #1789 b21ee41a Thanks @JacobMGEvans! - fix: getMonth compatibility date Set correct month for compatibility_date when initializing a new Worker

    resolves #1766

  • #1694 3fb730a3 Thanks @yjl9903! - feat: starting pages dev server doesn't require command when proxy port provided
  • #1729 ebb5b88f Thanks @JacobMGEvans! - feat: autogenerated config from dash

    Makes wrangler init's --from-dash option pull in data from Cloudflare's dashboard to generate a wrangler.toml file populated with configuration from an existing Worker. This is a first step towards making wrangler init more useful for folks who are already using Cloudflare's products on the Dashboard.

    related discussion #1623 resolves #1638

  • #1781 603d0b35 Thanks @JacobMGEvans! - feat: Publish Origin Messaging feat: warn about potential conflicts during publish and init --from-dash.

    • If publishing to a worker that has been modified in the dashboard, warn that the dashboard changes will be overwritten.
    • When initializing from the dashboard, warn that future changes via the dashboard will not automatically appear in the local Worker config.

    resolves #1737

  • #1735 de29a445 Thanks @cameron-robey! - feat: new internal middleware

    A new way of registering middleware that gets bundled and executed on the edge.

    • the same middleware functions can be used for both modules workers and service workers
    • only requires running esbuild a fixed number of times, rather than for each middleware added

2.0.29

Patch Changes

  • #1762 23f89216 Thanks @petebacondarwin! - Use getBasePath() when trying to specify paths to files relative to the base of the Wrangler package directory rather than trying to compute the path from Node.js constants like **dirname and **filename. This is because the act of bundling the source code can move the file that contains these constants around potentially breaking the relative path to the desired files.

    Fixes #1755

  • #1763 75f3ae82 Thanks @CarmenPopoviciu! - Add description field to _routes.json

    When generating routes for Functions projects, let's add a description so we know what wrangler version generated this config

  • #1538 2c9caf74 Thanks @rozenmd! - chore: refactor wrangler.dev API to not need React/Ink

    Prior to this change, wrangler.unstable_dev() would only support running one instance of wrangler at a time, as Ink only lets you render one instance of React. This resulted in test failures in CI.

    This change creates pure JS/TS versions of these React hooks:

    • useEsbuild
    • useLocalWorker
    • useCustomBuild
    • useTmpDir

    As a side-effect of removing React, tests should run faster in CI.

    Closes #1432 Closes #1419

2.0.28

Patch Changes

  • #1725 eb75413e Thanks @threepointone! - rename: worker_namespaces / dispatch_namespaces

    The Worker-for-Platforms team would like to rename this field to more closely match what it's called internally. This fix does a search+replace on this term. This feature already had an experimental warning, and no one's using it at the moment, so we're not going to add a warning/backward compat for existing customers.

  • #1736 800f8553 Thanks @threepointone! - fix: do not delete previously defined plain_text/json bindings on publish

    Currently, when we publish a worker, we delete an pre-existing bindings if they're not otherwise defined in wrangler.toml, and overwrite existing ones. But folks may be deploying with wrangler, and changing environment variables on the fly (like marketing messages, etc). It's annoying when deploying via wrangler blows away those values.

    This patch fixes one of those issues. It will not delete any older bindings that are not in wrangler.toml. It still does overwrite existing vars, but at least this gives a way for developers to have some vars that are not blown away on every publish.

  • #1726 0b83504c Thanks @GregBrimble! - fix: Multiworker and static asset dev bug preventing both from being used

    There was previously a collision on the generated filenames which resulted in the generated scripts looping and crashing in Miniflare with error code 7. By renaming one of the generated files, this is avoided.

  • #1727 3f9e8f63 Thanks @rozenmd! - fix: refresh token when we detect that the preview session has expired (error code 10049)

    When running wrangler dev, from time to time the preview session token would expire, and the dev server would need to be manually restarted. This fixes this, by refreshing the token when it expires.

    Closes #1446

  • #1730 27ad80ee Thanks @threepointone! - feat: --var name:value and --define name:value

    This enables passing values for [vars] and [define] via the cli. We have a number of usecases where the values to be injected during dev/publish aren't available statically (eg: a version string, some identifier for 3p libraries, etc) and reading those values only from wrangler.toml isn't good ergonomically. So we can now read those values when passed through the CLI.

    Example: add a var during dev: wrangler dev --var xyz:123 will inject the var xyz with string "123"

    (note, only strings allowed for --var)

    substitute a global value: wrangler dev --define XYZ:123 will replace every global identifier XYZ with the value 123.

    The same flags also work with wrangler publish.

    Also, you can use actual environment vars in these commands. e.g.: wrangler dev --var xyz:$XYZ will set xyz to whatever XYZ has been set to in the terminal environment.

  • #1700 d7c23e49 Thanks @penalosa! - Closes #1505 by extending wrangler tail to allow for passing worker routes as well as worker script names.

    For example, if you have a worker example-worker assigned to the route example.com/*, you can retrieve it's logs by running either wrangler tail example.com/* or wrangler tail example-worker—previously only wrangler tail example-worker was supported.

2.0.27

Patch Changes

  • #1686 a0a3ffde Thanks @Skye-31! - fix: pages dev correctly escapes regex characters in function paths (fixes #1685)
  • #1628 61e3f00b Thanks @Skye-31! - fix: pages dev process exit when proxied process exits

    Currently, if the process pages dev is proxying exists or crashes, pages dev does not clean it up, and attempts to continue proxying requests to it, resulting in it throwing 502 errors. This fixes that behaviour to make wrangler exit with the code the child_process exits with.

  • #1710 9943e647 Thanks @rozenmd! - fix: pass create-cloudflare the correct path

    wrangler generate was passing create-cloudflare an absolute path, rather than a folder name, resulting in "doubled-up" paths

  • #1663 a9f9094c Thanks @GregBrimble! - feat: Adds --compatibility-date and --compatibility-flags to wrangler pages dev

    Soon to follow in production.

  • #1653 46b73b52 Thanks @WalshyDev! - Fixed R2 create bucket API endpoint. The wrangler r2 bucket create command should work again

2.0.26

Patch Changes

  • #1655 fed80faa Thanks @jahands! - fix: Pages Functions custom _routes.json not being used

    Also cleaned up when we were reading generated _routes.json

  • #1626 f650a0b2 Thanks @JacobMGEvans! - fix: Added pathname to the constructed URL service bindings + wrangler dev ignores pathname when making a request.

    resolves #1598

  • #1622 02bdfde0 Thanks @Skye-31! - fix: Handle static files with multiple extensions, e.g. /a.b should resolve /a.b.html, if /a.b as a file does not exist
  • #1666 662dfdf9 Thanks @jahands! - fix: Consolidate routes that are over the limit to prevent failed deployments

    Rather than failing a deployment because a route is too long (>100 characters), it will now be shortened to the next available level. Eg. /foo/aaaaaaa... -> /foo/*

  • #1670 1b232aaf Thanks @Skye-31! - fix: dev.tsx opens 127.0.0.1 instead of 0.0.0.0 (doesn't work on windows)
  • #1656 37852672 Thanks @jahands! - fix: Warn when Pages Functions have no routes

    Building/publishing pages functions with no valid handlers would result in a Functions script containing no routes, often because the user is using the functions directory for something unrelated. This will no longer add an empty Functions script to the deployment, needlessly consuming Functions quota.

  • #1645 ac397480 Thanks @JacobMGEvans! - feat: download & initialize a wrangler project from dashboard worker

    Added wrangler init --from-dash <worker-name>, which allows initializing a wrangler project from a pre-existing worker in the dashboard.

    Resolves #1624 Discussion: #1623

    Notes: multiplart/form-data parsing is not currently supported in Undici, so a temporary workaround to slice off top and bottom boundaries is in place.

  • #1639 d86382a5 Thanks @matthewdavidrodgers! - fix: support 'exceededMemory' error status in tail

    While the exception for 'Worker exceeded memory limits' gets logged correctly when tailing, the actual status wasn't being counted as an error, and was falling through a switch case to 'unknown'

    This ensures filtering and logging reflects that status correctly

2.0.25

Patch Changes

  • #1609 fa8cb73f Thanks @jahands! - patch: Consolidate redundant routes when generating _routes.generated.json

    Example: ["/foo/:name", "/foo/bar"] => ["/foo/*"]

  • #1595 d4fbd0be Thanks @caass! - Add support for Alarm Events in wrangler tail

    wrangler tail --format pretty now supports receiving events from Durable Object Alarms, and will display the time the alarm was triggered.

    Additionally, any future unknown events will simply print "Unknown Event" instead of crashing the wrangler process.

    Closes #1519

  • #1642 a3e654f8 Thanks @jrf0110! - feat: Add output-routes-path to functions build

    This controls the output path of the _routes.json file. Also moves _routes.json generation to tmp directory during functions build + publish

  • #1606 24327289 Thanks @Skye-31! - chore: make prettier also fix changesets, as it causes checks to fail if they're not formatted
  • #1611 3df0fe04 Thanks @GregBrimble! - feat: Durable Object multi-worker bindings in local dev.

    Building on the recent work for multi-worker Service bindings in local dev, this now adds support for direct Durable Object namespace bindings.

    A parent (calling) Worker will look for child Workers (where the Durable Object has been defined) by matching the script_name configuration option with the child's Service name. For example, if you have a Worker A which defines a Durable Object, MyDurableObject, and Worker B which references A's Durable Object:

    name = "A"
    
    [durable_objects]
    bindings = [
    	{ name = "MY_DO", class_name = "MyDurableObject" }
    ]
    
    name = "B"
    
    [durable_objects]
    bindings = [
    	{ name = "REFERENCED_DO", class_name = "MyDurableObject", script_name = "A" }
    ]
    

    MY_DO will work as normal in Worker A. REFERENCED_DO in Worker B will point at A's Durable Object.

    Note: this only works in local mode (wrangler dev --local) at present.

  • #1602 ebd1d631 Thanks @huw! - fix: Pass usageModel to Miniflare in local dev

    This allows Miniflare to dynamically update the external subrequest limit for Unbound workers.

  • #1518 85ab8a93 Thanks @jahands! - feature: Reduce Pages Functions executions for Asset-only requests in _routes.json

    Manually create a _routes.json file in your build output directory to specify routes. This is a set of inclusion/exclusion rules to indicate when to run a Pages project's Functions. Note: This is an experemental feature and is subject to change.

  • #1641 5f5466ab Thanks @GregBrimble! - feat: Add support for using external Durable Objects from wrangler pages dev.

    An external Durable Object can be referenced using npx wrangler pages dev ./public --do MyDO=MyDurableObject@api where the Durable Object is made available on env.MyDO, and is described in a Workers service (name = "api") with the class name MyDurableObject.

    You must have the api Workers service running in as another wrangler dev process elsewhere already in order to reference that object.

  • #1605 9e632cdd Thanks @kimyvgy! - refactor: add --ip argument for wrangler pages dev & defaults IP to 0.0.0.0

    Add new argument --ip for the command wrangler pages dev, defaults to 0.0.0.0. The command wrangler dev is also defaulting to 0.0.0.0 instead of localhost.

  • #1604 9732fafa Thanks @WalshyDev! - Added R2 support for wrangler pages dev. You can add an R2 binding with --r2 <BINDING>.
  • #1608 9f02758f Thanks @jrf0110! - feat: Generate _routes.generated.json for Functions routing

    When using Pages Functions, a _routes.generated.json file is created to inform Pages how to route requests to a project's Functions Worker.

  • #1603 7ae059b3 Thanks @JacobMGEvans! - feat: R2 Object Deletequote Improving the R2 objects management, added the functionality to delete objects in a bucket.

    resolves #1584

2.0.24

Patch Changes

  • #1438 0a9fe918 Thanks @caass! - Initial implementation of wrangler generate

    • wrangler generate and wrangler generate <name> delegate to wrangler init.
    • wrangler generate <name> <template> delegates to create-cloudflare

    Naming behavior is replicated from Wrangler v1, and will auto-increment the worker name based on pre-existing directories.

  • #1550 aca9c3e7 Thanks @cameron-robey! - feat: describe current permissions in wrangler whoami

    Often users experience issues due to tokens not having the correct permissions associated with them (often due to new scopes being created for new products). With this, we print out a list of permissions associated with OAuth tokens with the wrangler whoami command to help them debug for OAuth tokens. We cannot access the permissions on an API key, so we direct the user to the location in the dashboard to achieve this. We also cache the scopes of OAuth tokens alongside the access and refresh tokens in the .wrangler/config file to achieve this.

    Currently unable to implement https://github.com/cloudflare/workers-sdk/issues/1371 - instead directs the user to the dashboard. Resolves https://github.com/cloudflare/workers-sdk/issues/1540

  • #1575 5b1f68ee Thanks @JacobMGEvans! - feat: legacy "kv-namespace" not supported In previous Wrangler 1, there was a legacy configuration that was considered a "bug" and removed.

    Before it was removed, tutorials, templates, blogs, etc... had utlized that configuration property to handle this in Wrangler 2 we will throw a blocking error that tell the user to utilize "kv_namespaces"

    resolves #1421

  • #1404 17f5b576 Thanks @threepointone! - feat: add cache control options to config.assets

    This adds cache control options to config.assets. This is already supported by the backing library (@cloudflare/kv-asset-handler) so we simply pass on the options at its callsite.

    Additionally, this adds a configuration field to serve an app in "single page app" mode, where a root index.html is served for all html/404 requests (also powered by the same library).

  • #1503 ebc1aa57 Thanks @threepointone! - feat: zero config multiworker development (local mode)

    Preamble: Typically, a Worker has been the unit of a javascript project on our platform. Any logic that you need, you fit into one worker, ~ 1MB of javascript and bindings. If you wanted to deploy a larger application, you could define different workers on different routes. This is fine for microservice style architectures, but not all projects can be cleaved along the route boundaries; you lose out on sharing code and resources, and can still cross the size limit with heavy dependencies.

    Service bindings provide a novel mechanism for composing multiple workers into a unified architecture. You could deploy shared code into a worker, and make requests to it from another worker. This lets you architect your code along functional boundaries, while also providing some relief to the 1MB size limit.

    I propose a model for developing multiple bound workers in a single project.

    Consider Worker A, at workers/a.js, with a wrangler.toml like so:

    name = 'A'
    
    [[services]]
    binding = 'Bee'
    service = 'B'
    

    and content like so:

    export default {
      fetch(req, env) {
        return env.Bee.fetch(req);
      },
    };
    

    Consider Worker B, at workers/b.js, with a wrangler.toml like so:

    name = 'B'
    

    and content like so:

    export default {
      fetch(req, env) {
        return new Response("Hello World");
      },
    };
    

    So, a worker A, bound to B, that simply passes on the request to B.

    Local mode:

    Currently, when I run wrangler dev --local on A (or switch from remote to local mode during a dev session), and make requests to A, they'll fail because the bindings don't exist in local mode.

    What I'd like, is to be able to run wrangler dev --local on B as well, and have my dev instance of A make requests to the dev instance of B. When I'm happy with my changes, I'd simply deploy both workers (again, ideally as a batched publish).

    Proposal: A local dev registry for workers.

    • Running wrangler dev on a machine should start up a local service registry (if there isn't one loaded already) as a server on a well known port.
    • Further, it should then "register" itself with the registry with metadata about itself; whether it's running in remote/local mode, the port and ip its dev server is listening on, and any additional configuration (eg: in remote mode, a couple of extra headers have to be added to every request made to the dev session, so we'd add that data into the registry as well.)
    • Every worker that has service bindings configured, should intercept requests to said binding, and instead make a request to the locally running instance of the service. It could rewrite these requests as it pleases.

    (In future PRs, we'll introduce a system for doing the same with remote mode dev, as well as mixed mode. )

    Related to https://github.com/cloudflare/workers-sdk/issues/1182 Fixes https://github.com/cloudflare/workers-sdk/issues/1040

  • #1551 1b54b54f Thanks @threepointone! - internal: middleware for modifying worker behaviour

    This adds an internal mechanism for applying multiple "middleware"/facades on to workers. This lets us add functionality during dev and/or publish, where we can modify requests or env, or other ideas. (See https://github.com/cloudflare/workers-sdk/issues/1466 for actual usecases)

    As part of this, I implemented a simple facade that formats errors in dev. To enable it you need to set an environment variable FORMAT_WRANGLER_ERRORS=true. This isn't a new feature we're shipping with wrangler, it's simply to demonstrate how to write middleware. We'll probably remove it in the future.

  • #1539 95d0f863 Thanks @threepointone! - fix: export durable objects correctly when using --assets

    The facade for static assets doesn't export any exports from the entry point, meaning Durable Objects will fail. This fix adds all exports to the facade's exports.

  • #1564 69713c5c Thanks @JacobMGEvans! - chore: updated wrangler readme providing additional context on configuration, deep link to init and fixing old link to beta docs.
  • #1581 3da184f1 Thanks @threepointone! - fix: apply multiworker dev facade only when required

    This fix makes sure the multiworker dev facade is applied to the input worker only where there are other wrangler dev instances running that are bound to the input worker. We also make sure we don't apply it when we already have a binding (like in remote mode).

  • #1576 f696ebb5 Thanks @petebacondarwin! - feat: add metricsEnabled header to CF API calls when developing or deploying a worker

    This allows us to estimate from API requests what proportion of Wrangler instances have enabled usage tracking, without breaking the agreement not to send data for those who have not opted in.

  • #1525 a692ace3 Thanks @threepointone! - feat: config.first_party_worker + dev facade

    This introduces configuration for marking a worker as a "first party" worker, to be used inside cloudflare to develop workers. It also adds a facade that's applied for first party workers in dev.

  • #1545 b3424e43 Thanks @Martin-Eriksson! - fix: Throw error if both directory and command is specified for pages dev

    The previous behavior was to silently ignore the command argument.

  • #1574 c61006ca Thanks @jahands! - fix: Retry check-missing call to make wrangler pages publish more reliable

    Before uploading files in wrangler pages publish, we make a network call to check what files need to be uploaded. This call could sometimes fail, causing the publish to fail. This change will retry that network call.

  • #1510 4dadc414 Thanks @matthewdavidrodgers! - refactor: touch up publishing to custom domains

    Couple things cleaned up here:

    Originally the usage of the /domains api (for publishing to custom domains) was a bit clumsy: we would attempt to optimistically publish, but the api would eagerly fail with specific error codes on why it occurred. This made for some weird control flow for retries with override flags, as well as fragile extraction of error messages.

    Now we use the new /domains/changeset api to generate a changeset of actions required to get to a new state of custom domains, which informs us up front of which domains would need to be updated and overridden, and we can pass flags as needed. I do make an extra hop back to the api to lookup what the custom domains requiring updates are already attached to, but given how helpful I imagine that to be, I'm for it.

    I also updated the api used for publishing the domains, from /domains to /domains/records. The latter was added to allow us to add flexibility for things like the /domains/changeset resource, and thus the former is being deprecated

  • #1535 eee7333b Thanks @cameron-robey! - feat: source maps support in wrangler dev remote mode

    Previously stack traces from runtime errors in wrangler dev remote mode, would give unhelpful stack traces from the bundled build that was sent to the server. Here, we use source maps generated as part of bundling to provide better stack traces for errors, referencing the unbundled files.

    Resolves https://github.com/cloudflare/workers-sdk/issues/1509

2.0.23

Patch Changes

  • #1523 e1e2ee5c Thanks @threepointone! - fix: don't log version spam in tests

    Currently in tests, we see a bunch of logspam from yargs about "version" being a reserved word, this patch removes that spam.

  • #1498 fe3fbd95 Thanks @cameron-robey! - feat: change version command to give update information When running version command, we want to display update information if current version is not up to date. Achieved by replacing default output with the wrangler banner. Previous behaviour (just outputting current version) reamins when !isTTY. Version command changed from inbuilt .version() from yargs, to a regular command to allow for asynchronous behaviour.

    Implements https://github.com/cloudflare/workers-sdk/issues/1492

  • #1431 a2e3a6b7 Thanks @Skye-31! - chore: Refactor wrangler pages dev to use Wrangler-proper's own dev server.

    This:

    • fixes some bugs (e.g. not proxying WebSockets correctly),
    • presents a much nicer UI (with the slick keybinding controls),
    • adds features that pages dev was missing (e.g. --local-protocol),
    • and reduces the maintenance burden of wrangler pages dev going forward.
  • #1528 60bdc31a Thanks @threepointone! - fix: prevent local mode restart

    In dev, we inject a patch for fetch() to detect bad usages. This patch is copied into the destination directory before it's used. esbuild appears to have a bug where it thinks a dependency has changed so it restarts once in local mode. The fix here is to copy the file to inject into a separate temporary dir.

    Fixes https://github.com/cloudflare/workers-sdk/issues/1515

  • #1502 be4ffde5 Thanks @threepointone! - polish: recommend using an account id when user details aren't available.

    When using an api token, sometimes the call to get a user's membership details fails with a 9109 error. In this scenario, a workaround to skip the membership check is to provide an account_id in wrangler.toml or via CLOUDFLARE_ACCOUNT_ID. This bit of polish adds this helpful tip into the error message.

  • #1479 862f14e5 Thanks @threepointone! - fix: read process.env.NODE_ENV correctly when building worker

    We replace process.env.NODE_ENV in workers with the value of the environment variable. However, we have a bug where when we make an actual build of wrangler (which has NODE_ENV set as "production"), we were also replacing the expression where we'd replace it in a worker. The result was that all workers would have process.env.NODE_ENV set to production, no matter what the user had set. The fix here is to use a "dynamic" value for the expression so that our build system doesn't replace it.

    Fixes https://github.com/cloudflare/workers-sdk/issues/1477

  • #1471 0953af8e Thanks @JacobMGEvans! - ci: implement CodeCov Integration CodeCov is used for analyzing code and tests to improve stability and maintainability. It does this by utilizing static code analysis and testing output to provide insights into things that need improving, security concerns, missing test coverage of critical code, and more, which can be missed even after exhaustive human review.
  • #1516 e178d6fb Thanks @threepointone! - polish: don't log an error message if wrangler dev startup is interrupted.

    When we quit wrangler dev, any inflight requests are cancelled. Any error handlers for those requests are ignored if the request was cancelled purposely. The check for this was missing for the prewarm request for a dev session, and this patch adds it so it dorsn't get logged to the terminal.

  • #1529 1a0ac8d0 Thanks @GregBrimble! - feat: Adds the --experimental-enable-local-persistence option to wrangler pages dev

    Previously, this was implicitly enabled and stored things in a .mf directory. Now we move to be in line with what wrangler dev does, defaults disabled, and stores in a wrangler-local-state directory.

  • #1514 9271680d Thanks @threepointone! - feat: add config.inspector_port

    This adds a configuration option for the inspector port used by the debugger in wrangler dev. This also includes a bug fix where we weren't passing on this configuration to local mode.

2.0.22

Patch Changes

  • #1482 9eb28ec Thanks @petebacondarwin! - feat: support controlling metrics gathering via WRANGLER_SEND_METRICS environment variable

    Setting the WRANGLER_SEND_METRICS environment variable will override any other metrics controls, such as the send_metrics property in wrangler.toml and cached user preference.

2.0.21

Patch Changes

  • #1474 f602df7 Thanks @threepointone! - fix: enable debugger in local mode

    During a refactor, we missed enabling the inspector by default in local mode. We also broke the logic that detects the inspector url exposed by the local server. This patch passes the argument correctly, fixes the detection logic. Further, it also lets you disable the inspector altogether with --inspect false, if required (for both remote and local mode).

    Fixes https://github.com/cloudflare/workers-sdk/issues/1436

  • #1470 01f49f1 Thanks @petebacondarwin! - fix: ensure that metrics user interactions do not break other UI

    The new metrics usage capture may interact with the user if they have not yet set their metrics permission. Sending metrics was being done concurrently with other commands, so there was a chance that the metrics UI broke the other command's UI. Now we ensure that metrics UI will happen synchronously.

2.0.20

Patch Changes

  • #1464 0059d84 Thanks @petebacondarwin! - ci: ensure that the SPARROW_SOURCE_KEY is included in release builds

    Previously, we were including the key in the "build" step of the release job. But this is only there to check that the build doesn't fail. The build is re-run inside the publish step, which is part of the "changeset" step. Now, we include the key in the "changeset" step to ensure it is there in the build that is published.

2.0.19

Patch Changes

  • #1410 52fb634 Thanks @petebacondarwin! - feat: add opt-in usage metrics gathering

    This change adds support in Wrangler for sending usage metrics to Cloudflare. This is an opt-in only feature. We will ask the user for permission only once per device. The user must grant permission, on a per device basis, before we send usage metrics to Cloudflare. The permission can also be overridden on a per project basis by setting send_metrics = false in the wrangler.toml. If Wrangler is running in non-interactive mode (such as in a CI job) and the user has not already given permission we will assume that we cannot send usage metrics.

    The aim of this feature is to help us learn what and how features of Wrangler (and also the Cloudflare dashboard) are being used in order to improve the developer experience.

  • #1463 a7ae733 Thanks @threepointone! - fix: ensure that a helpful error message is shown when on unsupported versions of node.js

    Our entrypoint for wrangler (bin/wrangler.js) needs to run in older versions of node and log a message to the user that they need to upgrade their version of node. Sometimes we use syntax in this entrypoint that doesn't run in older versions of node. crashing the script and failing to log the message. This fix adds a test in CI to make sure we don't regress on that behaviour (as well as fixing the current newer syntax usage)

    Fixes https://github.com/cloudflare/workers-sdk/issues/1443

  • #1459 4e425c6 Thanks @sidharthachatterjee! - fix: wrangler pages publish now more reliably retries an upload in case of a failure

    When wrangler pages publish is run, we make calls to an upload endpoint which could be rate limited and therefore fail. We currently retry those calls after a linear backoff. This change makes that backoff exponential which should reduce the likelihood of subsequent calls being rate limited.

2.0.18

Patch Changes

  • #1451 62649097 Thanks @WalshyDev! - Fixed an issue where Pages upload would OOM. This was caused by us loading all the file content into memory instead of only when required.
  • #1375 e9e98721 Thanks @JacobMGEvans! - polish: Compliance with the XDG Base Directory Specification Wrangler was creating a config file in the home directory of the operating system ~/.wrangler. The XDG path spec is a standard for storing files, these changes include XDG pathing compliance for .wrangler/* location and backwards compatibility with previous ~/.wrangler locations.

    resolves #1053

  • #1449 ee6c421b Thanks @alankemp! - Output additional information about uploaded scripts at WRANGLER_LOG=log level

2.0.17

Patch Changes

  • #1389 eab9542 Thanks @caass! - Remove delegation message when global wrangler delegates to a local installation

    A message used for debugging purposes was accidentally left in, and confused some folks. Now it'll only appear when WRANGLER_LOG is set to debug.

  • #1406 0f35556 Thanks @rozenmd! - fix: use fork to let wrangler know miniflare is ready

    This PR replaces our use of spawn in favour of fork to spawn miniflare in wrangler's dev function. This lets miniflare let wrangler know when we're ready to send requests.

    Closes #1408

  • #999 238b546 Thanks @caass! - Include devtools in wrangler monorepo

    Previously, wrangler relied on @threepointone's built-devtools. Now, these devtools are included in the wrangler repository.

  • #1424 8cf0008 Thanks @caass! - fix: Check config.assets when deciding whether to include a default entry point.

    An entry point isn't mandatory when using --assets, and we can use a default worker when doing so. This fix enables that same behaviour when config.assets is configured.

  • #1448 0d462c0 Thanks @threepointone! - polish: set checkjs: false and jsx: "react" in newly created projects

    When we create a new project, it's annoying having to set jsx: "react" when that's the overwhelmingly default choice, our compiler is setup to do it automatically, and the tsc error message isn't helpful. So we set jsx: "react" in the generated tsconfig.

    Setting checkJs: true is also annoying because it's not a common choice. So we set checkJs: false in the generated tsconfig.

  • #1450 172310d Thanks @threepointone! - polish: tweak static assets facade to log only real errors

    This prevents the abundance of NotFoundErrors being unnecessaryily logged.

  • #1415 f3a8452 Thanks @caass! - Emit type declarations for wrangler

    This is a first go-round of emitting type declarations alongside the bundled JS output, which should make it easier to use wrangler as a library.

  • #1427 3fa5041 Thanks @caass! - Check npm_config_user_agent to guess a user's package manager

    The environment variable npm_config_user_agent can be used to guess the package manager that was used to execute wrangler. It's imperfect (just like regular user agent sniffing!) but the package managers we support all set this property:

2.0.16

Patch Changes

  • #992 ee6b413 Thanks @petebacondarwin! - fix: add warning to fetch() calls that will change the requested port

    In Workers published to the Edge (rather than previews) there is a bug where a custom port on a downstream fetch request is ignored, defaulting to the standard port. For example, https://my.example.com:668 will actually send the request to https://my.example.com:443.

    This does not happen when using wrangler dev (both in remote and local mode), but to ensure that developers are aware of it this change displays a runtime warning in the console when the bug is hit.

    Closes #1320

  • #1378 2579257 Thanks @rozenmd! - chore: fully deprecate the preview command

    Before, we would warn folks that preview was deprecated in favour of dev, but then ran dev on their behalf. To avoid maintaining effectively two versions of the dev command, we're now just telling folks to run dev.

  • #1213 1bab3f6 Thanks @threepointone! - fix: pass routes to dev session

    We can pass routes when creating a dev session. The effect of this is when you visit a path that doesn't match the given routes, then it instead does a fetch from the deployed worker on that path (if any). We were previously passing */*, i.e, matching all routes in dev; this fix now passes configured routes instead.

  • #1355 61c31a9 Thanks @williamhorning! - fix: Fallback to non-interactive mode on error

    If the terminal isn't a TTY, fallback to non-interactive mode instead of throwing an error. This makes it so users of Bash on Windows can pipe to wrangler without an error being thrown.

    resolves #1303

  • #1337 1d778ae Thanks @JacobMGEvans! - polish: bundle reporter was not printing during publish errors

    The reporter is now called before the publish API call, printing every time.

    resolves #1328

  • #1335 49cf17e Thanks @JacobMGEvans! - feat: resolve --assets cli arg relative to current working directory

    Before we were resolving the Asset directory relative to the location of wrangler.toml at all times. Now the --assets cli arg is resolved relative to current working directory.

    resolves #1333

  • #1350 dee034b Thanks @rozenmd! - feat: export an (unstable) function that folks can use in their own scripts to invoke wrangler's dev CLI

    Closes #1350

  • #1386 4112001 Thanks @rozenmd! - feat: implement fetch for wrangler's unstable_dev API, and write our first integration test.

    Prior to this PR, users of unstable_dev had to provide their own fetcher, and guess the address and port that the wrangler dev server was using.

    With this implementation, it's now possible to test wrangler, using just wrangler (and a test framework):

    describe("worker", async () => {
      const worker = await wrangler.unstable_dev("src/index.ts");
    
      const resp = await worker.fetch();
    
      expect(resp).not.toBe(undefined);
      if (resp) {
        const text = await resp.text();
        expect(text).toMatchInlineSnapshot(`"Hello World!"`);
      }
    
      worker.stop();
    }
    

    Closes #1383 Closes #1384 Closes #1385

  • #1399 1ab71a7 Thanks @threepointone! - fix: rename --no-build to --no-bundle

    This fix renames the --no-build cli arg to --no-bundle. no-build wasn't a great name because it would imply that we don't run custom builds specified under [build] which isn't true. So we rename closer to what wrangler actually does, which is bundling the input. This also makes it clearer that it's a single file upload.

  • #1348 eb948b0 Thanks @threepointone! - polish: add an experimental warning if --assets is used

    We already have a warning when config.assets is used, this adds it for the cli argument as well.

  • #1326 12f2703 Thanks @timabb031! - fix: show console.error/console.warn logs when using dev --local.

    Prior to this change, logging with console.error/console.warn in a Worker wouldn't output anything to the console when running in local mode. This was happening because stderr data event handler was being removed after the Debugger listening... string was found.

    This change updates the stderr data event handler to forward on all events to process.stderr.

    Closes #1324

  • #1395 88f2702 Thanks @threepointone! - feat: cache account id selection

    This adds caching for account id fetch/selection for all wrangler commands.

    Currently, if we have an api/oauth token, but haven't provided an account id, we fetch account information from cloudflare. If a user has just one account id, we automatically choose that. If there are more than one, then we show a dropdown and ask the user to pick one. This is convenient, and lets the user not have to specify their account id when starting a project.

    However, if does make startup slow, since it has to do that fetch every time. It's also annoying for folks with multiple account ids because they have to pick their account id every time.

    So we now cache the account details into node_modules/.cache/wrangler (much like pages already does with account id and project name).

    This patch also refactors config-cache.ts; it only caches if there's a node_modules folder, and it looks for the closest node_modules folder (and not directly in cwd). I also added tests for when a node_modules folder isn't available. It also trims the message that we log to terminal.

    Closes https://github.com/cloudflare/workers-sdk/issues/300

  • #1391 ea7ee45 Thanks @threepointone! - fix: create a single session during remote dev

    Previously, we would be creating a fresh session for every script change during remote dev. While this worked, it makes iterating slower, and unnecessarily discards state. This fix makes it so we create only a single session for remote dev, and reuses that session on every script change. This also means we can use a single script id for every worker in a session (when a name isn't already given). Further, we also make the prewarming call of the preview space be non-blocking.

    Fixes https://github.com/cloudflare/workers-sdk/issues/1191

  • #1365 b9f7200 Thanks @threepointone! - fix: normalise account_id = '' to account_id: undefined

    In older templates, (i.e made for Wrangler v1.x), account_id ='' is considered as a valid input, but then ignored. With Wrangler 2, when running wrangler dev, we log an error, but it fixes itself after we get an account id. Much like https://github.com/cloudflare/wrangler2/issues/1329, the fix here is to normalise that value when we see it, and replace it with undefined while logging a warning.

    This fix also tweaks the messaging for a blank route value to suggest some user action.

  • #1300 dcffc93 Thanks @threepointone! - feat: publish --no-build

    This adds a --no-build flag to wrangler publish. We've had a bunch of people asking to be able to upload a worker directly, without any modifications. While there are tradeoffs to this approach (any linked modules etc won't work), we understand that people who need this functionality are aware of it (and the usecases that have presented themselves all seem to match this).

  • #1392 ff2e7cb Thanks @threepointone! - fix: keep site upload batches under 98 mb

    The maximum request size for a batch upload is 100 MB. We were previously calculating the upload key value to be under 100 MiB. Further, with a few bytes here and there, the size of the request can exceed 100 MiB. So this fix calculate using MB instead of MiB, but also brings down our own limit to 98 MB so there's some wiggle room for uploads.

    Fixes https://github.com/cloudflare/workers-sdk/issues/1367

  • #1297 40036e2 Thanks @threepointone! - feat: implement config.define

    This implements config.define. This lets the user define a map of keys to strings that will be substituted in the worker's source. This is particularly useful when combined with environments. A common usecase is for values that are sent along with metrics events; environment name, public keys, version numbers, etc. It's also sometimes a workaround for the usability of module env vars, which otherwise have to be threaded through request function stacks.

  • #1351 c770167 Thanks @geelen! - feat: add support for CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL to authorise

    This adds support for using the CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL env vars for authorising a user. This also adds support for CF_API_KEY + CF_EMAIL from Wrangler v1, with a deprecation warning.

  • #1352 4e03036 Thanks @JacobMGEvans! - bugfix: Allow route setting to be "" Previously Wrangler v1 behavior had allowed for route = "". To keep parity it will be possible to set route = "" in the config file and represent not setting a route, while providing a warning.

    resolves #1329

  • 4ad084e Thanks @sbquinlan! - feature By @sbquinlan: Set "upstream" miniflare option when running dev in local mode

2.0.15

Patch Changes

  • #1287 2072e27 Thanks @f5io! - fix: kv:key put/get binary file

    As raised in https://github.com/cloudflare/workers-sdk/issues/1254, it was discovered that binary uploads were being mangled by wrangler 2, whereas they worked in wrangler 1. This is because they were read into a string by providing an explicit encoding of utf-8. This fix reads provided files into a node Buffer that is then passed directly to the request.

    Subsequently https://github.com/cloudflare/workers-sdk/issues/1273 was raised in relation to a similar issue with gets from wrangler 2. This was happening due to the downloaded file being converted to utf-8 encoding as it was pushed through console.log. By leveraging process.stdout.write we can push the fetched ArrayBuffer to std out directly without inferring any specific encoding value.

  • #1265 e322475 Thanks @petebacondarwin! - fix: support all git versions for wrangler init

    If git does not support the --initial-branch argument then just fallback to the default initial branch name.

    We tried to be more clever about this but there are two many weird corner cases with different git versions on different architectures. Now we do our best, with recent versions of git, to ensure that the branch is called main but otherwise just make sure we don't crash.

    Fixes #1228

  • #1311 374655d Thanks @JacobMGEvans! - feat: add --text flag to decode kv:key get response values as utf8 strings

    Previously, all kv values were being rendered directly as bytes to the stdout, which makes sense if the value is a binary blob that you are going to pipe into a file, but doesn't make sense if the value is a simple string.

    resolves #1306

  • #1327 4880d54 Thanks @JacobMGEvans! - feat: resolve --site cli arg relative to current working directory

    Before we were resolving the Site directory relative to the location of wrangler.toml at all times. Now the --site cli arg is resolved relative to current working directory.

    resolves #1243

  • #1270 7ed5e1a Thanks @caass! - Delegate to a local install of wrangler if one exists.

    Users will frequently install wrangler globally to run commands like wrangler init, but we also recommend pinning a specific version of wrangler in a project's package.json. Now, when a user invokes a global install of wrangler, we'll check to see if they also have a local installation. If they do, we'll delegate to that version.

  • #1289 0d6098c Thanks @threepointone! - feat: entry point is not mandatory if --assets is passed

    Since we use a facade worker with --assets, an entry point is not strictly necessary. This makes a common usecase of "deploy a bunch of static assets" extremely easy to start, as a one liner npx wrangler dev --assets path/to/folder (and same with publish).

  • #1293 ee57d77 Thanks @petebacondarwin! - fix: do not crash in wrangler dev if user has multiple accounts

    When a user has multiple accounts we show a prompt to allow the user to select which they should use. This was broken in wrangler dev as we were trying to start a new ink.js app (to show the prompt) from inside a running ink.js app (the UI for wrangler dev).

    This fix refactors the ChooseAccount component so that it can be used directly within another component.

    Fixes #1258

  • #1299 0fd0c30 Thanks @threepointone! - polish: include a copy-pastable message when trying to publish without a compatibility date
  • #1269 fea87cf Thanks @petebacondarwin! - fix: do not consider ancestor files when initializing a project with a specified name

    When initializing a new project (via wrangler init) we attempt to reuse files in the current directory, or in an ancestor directory. In particular we look up the directory tree for package.json and tsconfig.json and use those instead of creating new ones.

    Now we only do this if you do not specify a name for the new Worker. If you do specify a name, we now only consider files in the directory where the Worker will be initialized.

    Fixes #859

  • #1321 8e2b92f Thanks @GregBrimble! - fix: Correctly resolve directories for 'wrangler pages publish'

    Previously, attempting to publish a nested directory or the current directory would result in parsing mangled paths which broke deployments. This has now been fixed.

  • #1293 ee57d77 Thanks @petebacondarwin! - fix: do not hang waiting for account choice when in non-interactive mode

    The previous tests for non-interactive only checked the stdin.isTTY, but you can have scenarios where the stdin is interactive but the stdout is not. For example when writing the output of a kv:key get command to a file.

    We now check that both stdin and stdout are interactive before trying to interact with the user.

  • #1294 f6836b0 Thanks @threepointone! - fix: serve --assets in dev + local mode

    A quick bugfix to make sure --assets/config.assets gets served correctly in dev --local.

2.0.14

Patch Changes

  • a4ba42a Thanks @threepointone! - Revert "Take 2 at moving .npmrc to the root of the repository (#1281)"

  • #1267 c667398 Thanks @rozenmd! - fix: let folks know the URL we're opening during login

    Closes #1259

2.0.12

Patch Changes

  • #1229 e273e09 Thanks @timabb031! - fix: parsing of node inspector url

    This fixes the parsing of the url returned by Node Inspector via stderr which could be received partially in multiple chunks or in a single chunk.

    Closes #1226

  • #1255 2d806dc Thanks @f5io! - fix: kv:key put binary file upload

    As raised in https://github.com/cloudflare/workers-sdk/issues/1254, it was discovered that binary uploads were being mangled by Wrangler v2, whereas they worked in Wrangler v1. This is because they were read into a string by providing an explicit encoding of utf-8. This fix reads provided files into a node Buffer that is then passed directly to the request.

  • #1248 db8a0bb Thanks @threepointone! - fix: instruct api to exclude script content on worker upload

    When we upload a script bundle, we get the actual content of the script back in the response. Sometimes that script can be large (depending on whether the upload was large), and currently it may even be a badly escaped string. We can pass a queryparam excludeScript that, as it implies, exclude the script content in the response. This fix does that.

    Fixes https://github.com/cloudflare/workers-sdk/issues/1222

  • #1250 e3278fa Thanks @rozenmd! - fix: pass localProtocol to miniflare for https server

    Closes #1247

  • #1253 eee5c78 Thanks @threepointone! - fix: resolve asset handler for --experimental-path

    In https://github.com/cloudflare/workers-sdk/pull/1241, we removed the vendored version of @cloudflare/kv-asset-handler, as well as the build configuration that would point to the vendored version when compiling a worker using --experimental-public. However, wrangler can be used where it's not installed in the package.json for the worker, or even when there's no package.json at all (like when wrangler is installed globally, or used with npx). In this situation, if the user doesn't have @cloudflare/kv-asset-handler installed, then building the worker will fail. We don't want to make the user install this themselves, so instead we point to a barrel import for the library in the facade for the worker.

  • #1234 3e94bc6 Thanks @threepointone! - feat: support --experimental-public in local mode

    --experimental-public is an abstraction over Workers Sites, and we can leverage miniflare's inbuilt support for Sites to serve assets in local mode.

  • #1236 891d128 Thanks @threepointone! - fix: generate site assets manifest relative to site.bucket

    We had a bug where we were generating asset manifest keys incorrectly if we ran wrangler from a different path to wrangler.toml. This fixes the generation of said keys, and adds a test for it.

    Fixes #1235

  • #1216 4eb70f9 Thanks @JacobMGEvans! - feat: reload server on configuration changes, the values passed into the server during restart will be bindings

    resolves #439

  • #1231 5206c24 Thanks @threepointone! - feat: build.watch_dir can be an array of paths

    In projects where:

    • all the source code isn't in one folder (like a monorepo, or even where the worker has non-standard imports across folders),
    • we use a custom build, so it's hard to statically determine folders to watch for changes

    ...we'd like to be able to specify multiple paths for custom builds, (the config build.watch_dir config). This patch enables such behaviour. It now accepts a single path as before, or optionally an array of strings/paths.

    Fixes https://github.com/cloudflare/workers-sdk/issues/1095

  • #1241 471cfef Thanks @threepointone! - use @cloudflare/kv-asset-handler for --experimental-public

    We'd previously vendored in @cloudflare/kv-asset-handler and mime for --experimental-public. We've since updated @cloudflare/kv-asset-handler to support module workers correctly, and don't need the vendored versions anymore. This patch uses the lib as a dependency, and deletes the vendor folder.

2.0.11

Patch Changes

  • #1239 df55709 Thanks @threepointone! - polish: don't include folder name in Sites kv asset keys

    As reported in https://github.com/cloudflare/workers-sdk/issues/1189, we're including the name of the folder in the keys of the KV store that stores the assets. This doesn't match v1 behaviour. It makes sense not to include these since, we should be able to move around the folder and not have to reupload the entire folder again.

    Fixes https://github.com/cloudflare/workers-sdk/issues/1189

  • #1210 785d418 Thanks @GregBrimble! - feat: Upload the delta for wrangler pages publish

    We now keep track of the files that make up each deployment and intelligently only upload the files that we haven't seen. This means that similar subsequent deployments should only need to upload a minority of files and this will hopefully make uploads even faster.

  • #1218 f8a21ed Thanks @threepointone! - fix: warn on unexpected fields on config.triggers

    This adds a warning when we find unexpected fields on the triggers config (and any future fields that use the isObjectWith() validation helper)

2.0.9

Patch Changes

  • #1212 101342e Thanks @petebacondarwin! - fix: do not crash when not logged in and switching to remote dev mode

    Previously, if you are not logged in when running wrangler dev it will only try to log you in if you start in "remote" mode. In "local" mode there is no need to be logged in, so it doesn't bother to try to login, and then will crash if you switch to "remote" mode interactively.

    The problem was that we were only attempting to login once before creating the <Remote> component. Now this logic has been moved into a useEffect() inside <Remote> so that it will be run whether starting in "remote" or transitioning to "remote" from "local".

    The fact that the check is no longer done before creating the components is proven by removing the mockAccountId() and mockApiToken() calls from the dev.test.ts files.

    Fixes #18

  • #1188 b44cc26 Thanks @petebacondarwin! - fix: fallback on old zone-based API when account-based route API fails

    While we wait for changes to the CF API to support API tokens that do not have "All Zone" permissions, this change provides a workaround for most scenarios.

    If the bulk-route request fails with an authorization error, then we fallback to the Wrangler v1 approach, which sends individual route updates via a zone-based endpoint.

    Fixes #651

2.0.8

Patch Changes

  • #1184 4a10176 Thanks @timabb031! - polish: add cron trigger to wrangler.toml when new Scheduled Worker is created

    When wrangler init is used to create a new Scheduled Worker a cron trigger (1 * * * *) will be added to wrangler.toml, but only if wrangler.toml is being created during init. If wrangler.toml exists prior to running wrangler init then wrangler.toml will remain unchanged even if the user selects the "Scheduled Handler" option. This is as per existing tests in init.test.ts that ensure wrangler.toml is never overwritten after agreeing to prompts. That can change if it needs to.

  • #1163 52c0bf0 Thanks @threepointone! - fix: only log available bindings once in dev

    Because we were calling printBindings during the render phase of <Dev/>, we were logging the bindings multiple times (render can be called multiple times, and the interaction of Ink's stdout output intermingled with console is a bit weird). We could have put it into an effect, but I think a better solution here is to simply log it before we even start rendering <Dev/> (so we could see the bindings even if Dev fails to load, for example).

    This also adds a fix that masks any overriden values so that we don't accidentally log potential secrets into the terminal.

  • #1122 c2d2f44 Thanks @petebacondarwin! - fix: display chained errors from the CF API

    For example if you have an invalid CF_API_TOKEN and try running wrangler whoami you now get the additional 6111 error information:

    ✘ [ERROR] A request to the Cloudflare API (/user) failed.
    
      Invalid request headers [code: 6003]
      - Invalid format for Authorization header [code: 6111]
    
  • #1152 b817136 Thanks @threepointone! - polish: Give a copy-paste config when [migrations] are missing

    This gives a slightly better message when migrations are missing for declared durable objcts. Specifically, it gives a copy-pastable section to add to wrangler.toml, and doesn't show the warning at all for invalid class names anymore.

    Partially makes https://github.com/cloudflare/workers-sdk/issues/1076 better.

  • #1141 a8c509a Thanks @rozenmd! - fix: rename "publish" package.json script to "deploy"

    Renaming the default "publish" package.json script to "deploy" to avoid confusion with npm's publish command.

    Closes #1121

  • #1175 e978986 Thanks @timabb031! - feature: allow user to select a handler template with wrangler init

    This allows the user to choose which template they'd like to use when they are prompted to create a new worker. The options are currently "None"/"Fetch Handler"/"Scheduled Handler". Support for new handler types such as email can be added easily in future.

2.0.7

Patch Changes

  • #1110 515a52f Thanks @rozenmd! - fix: print instructions even if installPackages fails to fetch npm packages
  • #1051 7e2e97b Thanks @rozenmd! - feat: add support for using wrangler behind a proxy

    Configures the undici library (the library wrangler uses for fetch) to send all requests via a proxy selected from the first non-empty environment variable from "https_proxy", "HTTPS_PROXY", "http_proxy" and "HTTP_PROXY".

  • #1089 de59ee7 Thanks @rozenmd! - fix: batch package manager installs so folks only have to wait once

    When running wrangler init, we install packages as folks confirm their options. This disrupts the "flow", particularly on slower internet connections.

    To avoid this disruption, we now only install packages once we're done asking questions.

    Closes #1036

  • #1073 6bb2564 Thanks @caass! - Add a better message when a user doesn't have a Chromium-based browser.

    Certain functionality we use in wrangler depends on a Chromium-based browser. Previously, we would throw a somewhat arcane error that was hard (or impossible) to understand without knowing what we needed. While ideally all of our functionality would work across all major browsers, as a stopgap measure we can at least inform the user what the actual issue is.

    Additionally, add support for Brave as a Chromium-based browser.

  • #1079 fb0dec4 Thanks @caass! - Print the bindings a worker has access to during dev and publish

    It can be helpful for a user to know exactly what resources a worker will have access to and where they can access them, so we now log the bindings available to a worker during wrangler dev and wrangler publish.

  • #1058 1a59efe Thanks @threepointone! - refactor: detect missing [migrations] during config validation

    This does a small refactor -

    • During publish, we were checking whether [migrations] were defined in the presence of [durable_objects], and warning if not. This moves it into the config validation step, which means it'll check for all commands (but notably dev)
    • It moves the code to determine current migration tag/migrations to upload into a helper. We'll be reusing this soon when we upload migrations to dev.
  • #1090 85fbfe8 Thanks @petebacondarwin! - refactor: remove use of any

    This "quick-win" refactors some of the code to avoid the use of any where possible. Using any can cause type-checking to be disabled across the code in unexpectedly wide-impact ways.

    There is one other use of any not touched here because it is fixed by #1088 separately.

  • #1088 d63d790 Thanks @petebacondarwin! - fix: ensure that the proxy server shuts down to prevent wrangler dev from hanging

    When running wrangler dev we create a proxy to the actual remote Worker. After creating a connection to this proxy by a browser request the proxy did not shutdown. Now we use a HttpTerminator helper library to force the proxy to close open connections and shutdown correctly.

    Fixes #958

  • #1099 175737f Thanks @petebacondarwin! - fix: delegate wrangler build to wrangler publish

    Since wrangler publish --dry-run --outdir=dist is basically the same result as what Wrangler v1 did with wrangler build let's run that for the user if they try to run wrangler build.

  • #1081 8070763 Thanks @rozenmd! - fix: friendlier error for when a subdomain hasn't been configured in dev mode
  • #1123 15e5c12 Thanks @timabb031! - chore: updated new worker ts template with env/ctx parameters and added Env interface
  • #1080 4a09c1b Thanks @caass! - Improve messaging when bulk deleting or uploading KV Pairs

    Closes #555

  • #1000 5a8e8d5 Thanks @JacobMGEvans! - pages dev <dir> & wrangler pages functions build will have a --node-compat flag powered by @esbuild-plugins/node-globals-polyfill (which in itself is powered by rollup-plugin-node-polyfills). The only difference in pages will be it does not check the wrangler.toml so the node_compat = truewill not enable it for wrangler pages functionality.

    resolves #890

  • #1028 b7a9ce6 Thanks @GregBrimble! - feat: Use new bulk upload API for 'wrangler pages publish'

    This raises the file limit back up to 20k for a deployment.

2.0.6

Patch Changes

  • #1018 cd2c42f Thanks @threepointone! - fix: strip leading */*. from routes when deducing a host for dev

    When given routes, we use the host name from the route to deduce a zone id to pass along with the host to set with dev session. Route patterns can include leading */*., which we don't account for when deducing said zone id, resulting in subtle errors for the session. This fix strips those leading characters as appropriate.

    Fixes https://github.com/cloudflare/workers-sdk/issues/1002

  • #1052 233eef2 Thanks @petebacondarwin! - fix: display the correct help information when a subcommand is invalid

    Previously, when an invalid subcommand was used, such as wrangler r2 foo, the help that was displayed showed the top-level commands prefixed by the command in used. E.g.

    wrangler r2 init [name]       📥 Create a wrangler.toml configuration file
    wrangler r2 dev [script]      👂 Start a local server for developing your worker
    wrangler r2 publish [script]  🆙 Publish your Worker to Cloudflare.
    ...
    

    Now the correct command help is displayed:

    $ wrangler r2 foo
    
    ✘ [ERROR] Unknown argument: foo
    

wrangler r2

📦 Interact with an R2 store

Commands: wrangler r2 bucket Manage R2 buckets

Flags: -c, --config Path to .toml configuration file [string] -h, --help Show help [boolean] -v, --version Show version number [boolean]


Fixes #871

* [#906](https://github.com/cloudflare/workers-sdk/pull/906) [`3279f10`](https://github.com/cloudflare/workers-sdk/commit/3279f103fb3b1c27addb4c69c30ad970ab0d5f77) Thanks [@threepointone](https://github.com/threepointone)! - feat: implement support for service bindings

This adds experimental support for service bindings, aka worker-to-worker bindings. It's lets you "call" a worker from another worker, without incurring any network cost, and (ideally) with much less latency. To use it, define a `[services]` field in `wrangler.toml`, which is a map of bindings to worker names (and environment). Let's say you already have a worker named "my-worker" deployed. In another worker's configuration, you can create a service binding to it like so:

```toml
[[services]]
binding = "MYWORKER"
service = "my-worker"
environment = "production" # optional, defaults to the worker's `default_environment` for now

And in your worker, you can call it like so:

export default {
  fetch(req, env, ctx) {
    return env.MYWORKER.fetch(new Request("http://domain/some-path"));
  },
};

Fixes https://github.com/cloudflare/workers-sdk/issues/1026

  • #1045 8eeef9a Thanks @jrf0110! - fix: Incorrect extension extraction from file paths.

    Our extension extraction logic was taking into account folder names, which can include periods. The logic would incorrectly identify a file path of .well-known/foo as having the extension of well-known/foo when in reality it should be an empty string.

  • #1033 ffce3e3 Thanks @petebacondarwin! - fix: wrangler init should not crash if Git is not available on Windows

    We check for the presence of Git by trying to run git --version. On non-Windows we get an Error with code set to "ENOENT". One Windows we get a different error:

    {
      "shortMessage":"Command failed with exit code 1: git --version",
      "command":"git --version",
      "escapedCommand":"git --version",
      "exitCode":1,
      "stdout":"",
      "stderr":"'git' is not recognized as an internal or external command,\r\noperable program or batch file.",
      "failed":true,
      "timedOut":false,
      "isCanceled":false,
      "killed":false
    }
    

    Since we don't really care what the error is, now we just assume that Git is not available if an error is thrown.

    Fixes #1022

  • #982 6791703 Thanks @matthewdavidrodgers! - feature: add support for publishing to Custom Domains

    With the release of Custom Domains for workers, users can publish directly to a custom domain on a route, rather than creating a dummy DNS record first and manually pointing the worker over - this adds the same support to wrangler.

    Users declare routes as normal, but to indicate that a route should be treated as a custom domain, a user simply uses the object format in the toml file, but with a new key: custom_domain (i.e. routes = [{ pattern = "api.example.com", custom_domain = true }])

    When wrangler sees a route like this, it peels them off from the rest of the routes and publishes them separately, using the /domains api. This api is very defensive, erroring eagerly if there are conflicts in existing Custom Domains or managed DNS records. In the case of conflicts, wrangler prompts for confirmation, and then retries with parameters to indicate overriding is allowed.

  • #1057 608dcd9 Thanks @petebacondarwin! - fix: pages "command" can consist of multiple words

    On Windows, the following command wrangler pages dev -- foo bar would error saying that bar was not a known argument. This is because foo and bar are passed to Yargs as separate arguments.

    A workaround is to put the command in quotes: wrangler pages dev -- "foo bar". But this fix makes the command argument variadic, which also solves the problem.

    Fixes #965

  • #1027 3545e41 Thanks @rozenmd! - feat: trying to use node builtins should recommend you enable node_compat in wrangler.toml

2.0.5

Patch Changes

2.0.4

Patch Changes

  • #980 202f37d Thanks @threepointone! - fix: throw appropriate error when we detect an unsupported version of node

    When we start up the CLI, we check what the minimum version of supported node is, and throw an error if it isn't at least 16.7. However, the script that runs this, imports node:child_process and node:path, which was only introduced in 16.7. It was backported to older versions of node, but only in last updates to majors. So for example, if someone used 14.15.4, the script would throw because it wouldn't be able to find node:child_process (but it would work on v14.19.2).

    The fix here is to not use the prefixed versions of these built-ins in the bootstrap script. Fixes https://github.com/cloudflare/workers-sdk/issues/979

2.0.3

Patch Changes

  • #956 1caa5f7 Thanks @threepointone! - fix: don't crash during init if git is not installed

    When a command isn't available on a system, calling execa() on it throws an error, and not just a non zero exitCode. This patch fixes the flow so we don't crash the whole process when that happens on testing the presence of git when calling wrangler init.

    Fixes https://github.com/cloudflare/workers-sdk/issues/950

  • #970 35e780b Thanks @GregBrimble! - fix: Fixes Pages Plugins and static asset routing.

    There was previously a bug where a relative pathname would be missing the leading slash which would result in routing errors.

  • #957 e0a0509 Thanks @JacobMGEvans! - refactor: Moving --legacy-env out of global The --legacy-env flag was in global scope, which only certain commands utilize the flag for functionality, and doesnt do anything for the other commands.

    resolves #933

  • #948 82165c5 Thanks @petebacondarwin! - fix: improve error message if custom build output is not found

    The message you get if Wrangler cannot find the output from the custom build is now more helpful. It will even look around to see if there is a suitable file nearby and make suggestions about what should be put in the main configuration.

    Closes #946

  • #952 ae3895e Thanks @d3lm! - feat: use host specific callback url

    To allow OAuth to work on environments such as WebContainer we have to generate a host-specific callback URL. This PR uses @webcontainer/env to generate such URL only for running in WebContainer. Otherwise the callback URL stays unmodified.

  • #951 09196ec Thanks @petebacondarwin! - fix: look for an alternate port in the dev command if the configured one is in use

    Previously, we were only calling getPort() if the configured port was undefined. But since we were setting the default for this during validation, it was never undefined.

    Fixes #949

  • #964 0dfd95f Thanks @JacobMGEvans! - fix: KV not setting correctly The KV has URL inputs, which in the case of / would get collapsed and lost. T:o handle special characters encodeURIComponent is implemented.

    resolves #961

2.0.2

Patch Changes

  • #941 d84b568 Thanks @threepointone! - fix: bundle worker as iife if detected as a service worker

    We detect whether a worker is a "modules" format worker by the presence of a default export. This is a pretty good heuristic overall, but sometimes folks can make mistakes. One situation that's popped up a few times, is people writing exports, but still writing it in "service worker" format. We detect this fine, and log a warning about the exports, but send it up with the exports included. Unfortunately, our runtime throws when we mark a worker as a service worker, but still has exports. This patch fixes it so that the exports are not included in a service-worker worker.

    Note that if you're missing an event listener, it'll still error with "No event handlers were registered. This script does nothing." but that's a better error than the SyntaxError even when the listener was there.

    Fixes https://github.com/cloudflare/workers-sdk/issues/937

2.0.1

Patch Changes

  • #930 bc28bea Thanks @GregBrimble! - fix: Default to creating a new project when no existing ones are available for 'wrangler pages publish'

2.0.0

Major Changes

  • #928 7672f99 Thanks @threepointone! - Wrangler 2.0.0

    Wrangler 2.0 is a full rewrite. Every feature has been improved, while retaining as much backward compatibility as we could. We hope you love it. It'll only get better.

0.0.34

Patch Changes

  • #926 7b38a7c Thanks @threepointone! - polish: show paths of created files with wrangler init

    This patch modifies the terminal when running wrangler init, to show the proper paths of files created during it (like package.json, tsconfig.json, etc etc). It also fixes a bug where we weren't detecting the existence of src/index.js for a named worker before asking to create it.

0.0.33

Patch Changes

  • #924 3bdba63 Thanks @threepointone! - fix: withwrangler init, test for existence of package.json/ tsconfig.json / .git in the right locations

    When running wrangler.init, we look for the existence of package.json, / tsconfig.json / .git when deciding whether we should create them ourselves or not. Because name can be a relative path, we had a bug where we don't starting look from the right directory. We also had a bug where we weren't even testing for the existence of the .git directory correctly. This patch fixes that initial starting location, tests for .git as a directory, and correctly decides when to create those files.

0.0.32

Patch Changes

  • #922 e2f9bb2 Thanks @threepointone! - feat: offer to create a git repo when calling wrangler init

    Worker projects created by wrangler init should also be managed by source control (popularly, git). This patch adds a choice in wrangler init to make the created project into a git repository.

    Additionally, this fixes a bug in our tests where mocked confirm() and prompt() calls were leaking between tests.

    Closes https://github.com/cloudflare/workers-sdk/issues/847

0.0.31

Patch Changes

  • #916 4ef5fbb Thanks @petebacondarwin! - fix: display and error and help for wrangler init --site

    The --site option is no longer supported. This change adds information about how to create a new Sites project by cloning a repository. It also adds links to the Worker Sites and Cloudflare Pages docs.

  • #908 f8dd31e Thanks @threepointone! - fix: fix isolate prewarm logic for wrangler dev

    When calling wrangler dev, we make a request to a special URL that "prewarms" the isolate running our Worker so that we can attach devtools etc to it before actually making a request. We'd implemented it wrongly, and because we'd silenced its errors, we weren't catching it. This patch fixes the logic (based on Wrangler v1.x's implementation) and enables logging errors when the prewarm request fails.

    As a result, profiling starts working again as expected. Fixes https://github.com/cloudflare/workers-sdk/issues/907

  • #913 dfeed74 Thanks @threepointone! - polish: add a deprecation warning to --inspect on dev

    We have a blogposts and docs that says you need to pass --inspect to use devtools and/or profile your Worker. In wrangler v2, we don't need to pass the flag anymore. Using it right now will throw an error, so this patch makes it a simple warning instead.

  • #920 57cf221 Thanks @threepointone! - chore: don't minify bundles

    When errors in wrangler happen, it's hard to tell where the error is coming from in a minified bundle. This patch removes the minification. We still set process.env.NODE_ENV = 'production' in the bundle so we don't run dev-only paths in things like React.

    This adds about 2 mb to the bundle, but imo it's worth it.

  • #910 fe0344d Thanks @taylorlee! - fix: support preview buckets for r2 bindings

    Allows wrangler2 to perform preview & dev sessions with a different bucket than the published worker's binding.

    This matches kv's preview_id behavior, and brings the Wrangler v2 implementation in sync with Wrangler v1.

0.0.30

Patch Changes

  • #901 b246066 Thanks @threepointone! - chore: minify bundle, don't ship sourcemaps

    We haven't found much use for sourcemaps in production, and we should probably minify the bundle anyway. This will also remove an dev only warnings react used to log.

  • #904 641cdad Thanks @GregBrimble! - feat: Adds 'assets:' loader for Pages Functions.

    This lets users and Plugin authors include a folder of static assets in Pages Functions.

    export { onRequest } from "assets:../folder/of/static/assets";
    

    More information in our docs.

  • #905 c57ff0e Thanks @JacobMGEvans! - chore: removed Sentry and related reporting code. Automated reporting of Wrangler errors will be reimplemented after further planning.

0.0.29

Patch Changes

  • #897 d0801b7 Thanks @threepointone! - polish: tweak the message when .dev.vars is used

    This tweaks the mssage when a .dev.vars file is used so that it doesn't imply that the user has to copy the values from it into their wrangler.toml.

  • #880 aad1418 Thanks @GregBrimble! - fix: Stop unnecessarily amalgamating duplicate headers in Pages Functions

    Previously, set-cookie multiple headers would be combined because of unexpected behavior in the spec.

  • #892 b08676a Thanks @GregBrimble! - fix: Adds the leading slash to Pages deployment manifests that the API expects, and fixes manifest generation on Windows machines.
  • #852 6283ad5 Thanks @JacobMGEvans! - feat: non-TTY check for required variables Added a check in non-TTY environments for account_id, CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN. If account_id exists in wrangler.toml then CLOUDFLARE_ACCOUNT_ID is not needed in non-TTY scope. The CLOUDFLARE_API_TOKEN is necessary in non-TTY scope and will always error if missing.

    resolves #827

  • #893 5bf17ca Thanks @petebacondarwin! - fix: remove bold font from additional lines of warnings and errors

    Previously, when a warning or error was logged, the entire message was formatted in bold font. This change makes only the first line of the message bold, and the rest is formatted with a normal font.

  • #882 1ad7570 Thanks @petebacondarwin! - feat: add support for reading build time env variables from a .env file

    This change will automatically load up a .env file, if found, and apply its values to the current environment. An example would be to provide a specific CLOUDFLARE_ACCOUNT_ID value.

    Related to cloudflare#190

  • #887 2bb4d30 Thanks @threepointone! - polish: accept Enter as a valid key in confirm dialogs

    Instead of logging "Unrecognised input" when hitting return/enter in a confirm dialog, we should accept it as a confirmation. This patch also makes the default choice "y" bold in the dialog.

  • #891 bae5ba4 Thanks @GregBrimble! - feat: Adds interactive prompts for the 'wrangler pages publish' and related commands.

    Additionally, those commands now read from node_modules/.cache/wrangler/pages.json to persist users' account IDs and project names.

  • #888 b77aa38 Thanks @threepointone! - polish: s/DEPRECATION/Deprecation

    This removes the scary uppercase from DEPRECATION warnings. It also moves the service environment usage warning into diagnostics instead of logging it directly.

  • #879 f694313 Thanks @petebacondarwin! - feat: read vars overrides from a local file for wrangler dev

    The vars bindings can be specified in the wrangler.toml configuration file. But "secret" vars are usually only provided at the server - either by creating them in the Dashboard UI, or using the wrangler secret command.

    It is useful during development, to provide these types of variable locally. When running wrangler dev we will look for a file called .dev.vars, situated next to the wrangler.toml file (or in the current working directory if there is no wrangler.toml). Any values in this file, formatted like a dotenv file, will add to or override vars bindings provided in the wrangler.toml.

    Related to #190

0.0.28

Patch Changes

  • #843 da12cc5 Thanks @threepointone! - fix: site.entry-point is no longer a hard deprecation

    To make migration of v1 projects easier, Sites projects should still work, including the entry-point field (which currently errors out). This enables site.entry-point as a valid entry point, with a deprecation warning.

  • #877 97f945f Thanks @caass! - Treat the "name" parameter in wrangler init as a path.

    This means that running wrangler init . will create a worker in the current directory, and the worker's name will be the name of the current directory.

    You can also run wrangler init path/to/my-worker and a worker will be created at [CWD]/path/to/my-worker with the name my-worker,

  • #851 277b254 Thanks @threepointone! - polish: do not log the error object when refreshing a token fails

    We handle the error anyway (by doing a fresh login) which has its own logging and messaging. In the future we should add a DEBUG mode that logs all requests/errors/warnings, but that's for later.

  • #869 f1423bf Thanks @threepointone! - feat: experimental --node-compat / config.node_compat

    This adds an experimental node.js compatibility mode. It can be enabled by adding node_compat = true in wrangler.toml, or by passing --node-compat as a command line arg for dev/publish commands. This is currently powered by @esbuild-plugins/node-globals-polyfill (which in itself is powered by rollup-plugin-node-polyfills).

    We'd previously added this, and then removed it because the quality of the polyfills isn't great. We're reintroducing it regardless so we can start getting feedback on its usage, and it sets up a foundation for replacing it with our own, hopefully better maintained polyfills.

    Of particular note, this means that what we promised in https://blog.cloudflare.com/announcing-stripe-support-in-workers/ now actually works.

    This patch also addresses some dependency issues, specifically leftover entries in package-lock.json.

  • #866 8b227fc Thanks @caass! - Add a runtime check for wrangler dev local mode to avoid erroring in environments with no AsyncLocalStorage class

    Certain runtime APIs are only available to workers during the "request context", which is any code that returns after receiving a request and before returning a response.

    Miniflare emulates this behavior by using an AsyncLocalStorage and checking at runtime to see if you're using those APIs during the request context.

    In certain environments AsyncLocalStorage is unavailable, such as in a webcontainer. This function figures out if we're able to run those "request context" checks and returns a set of options that indicate to miniflare whether to run the checks or not.

  • #829 f08aac5 Thanks @JacobMGEvans! - feat: Add validation to the name field in configuration. The validation will warn users that the field can only be "type string, alphanumeric, underscores, and lowercase with dashes only" using the same RegEx as the backend

    resolves #795 #775

  • #868 6ecb1c1 Thanks @threepointone! - feat: implement service environments + durable objects

    Now that the APIs for getting migrations tags of services works as expected, this lands support for publishing durable objects to service environments, including migrations. It also removes the error we used to throw when attempting to use service envs + durable objects.

    Fixes https://github.com/cloudflare/workers-sdk/issues/739

0.0.27

Patch Changes

  • #838 9c025c4 Thanks @threepointone! - fix: remove timeout on custom builds, and make sure logs are visible

    This removes the timeout we have for custom builds. We shouldn't be applying this timeout anyway, since it doesn't block wrangler, just the user themselves. Further, in https://github.com/cloudflare/workers-sdk/pull/759, we changed the custom build's process stdout/stderr config to "pipe" to pass tests, however that meant we wouldn't see logs in the terminal anymore. This patch removes the timeout, and brings back proper logging for custom builds.

  • #349 9d04a68 Thanks @GregBrimble! - chore: rename --script-path to --outfile for wrangler pages functions build command.
  • #836 28e3b17 Thanks @threepointone! - fix: toggle workers.dev subdomains only when required

    This fix -

    • passes the correct query param to check whether a workers.dev subdomain has already been published/enabled
    • thus enabling it only when it's not been enabled
    • it also disables it only when it's explicitly knows it's already been enabled

    The effect of this is that publishes are much faster.

  • #794 ee3475f Thanks @JacobMGEvans! - fix: Error messaging from failed login would dump a JSON.parse error in some situations. Added a fallback if .json fails to parse it will attempt .text() then throw result. If both attempts to parse fail it will throw an UnknownError with a message showing where it originated.

    resolves #539

  • #824 62af4b6 Thanks @threepointone! - feat: publish --dry-run

    It can be useful to do a dry run of publishing. Developers want peace of mind that a project will compile before actually publishing to live servers. Combined with --outdir, this is also useful for testing the output of publish. Further, it gives developers a chance to upload our generated sourcemap to a service like sentry etc, so that errors from the worker can be mapped against actual source code, but before the service actually goes live.

  • #839 f2d6de6 Thanks @threepointone! - fix: persist dev experimental storage state in feature specific dirs

    With --experimental-enable-local-persistence in dev, we were clobbering a single folder with data from kv/do/cache. This patch gives individual folders for them. It also enables persistence even when this is not true, but that stays only for the length of a session, and cleans itself up when the dev session ends.

    Fixes https://github.com/cloudflare/workers-sdk/issues/830

  • #820 60c409a Thanks @petebacondarwin! - fix: display a warning if the user has a miniflare section in their wrangler.toml.

    Closes #799

  • #796 3e0db3b Thanks @GregBrimble! - fix: Makes Response Headers object mutable after a call to next() in Pages Functions
  • #823 4a00910 Thanks @threepointone! - fix: don't log an error when wrangler dev is cancelled early

    We currently log an AbortError with a stack if we exit wrangler dev's startup process before it's done. This fix skips logging that error (since it's not an exception).

    Test plan:

    cd packages/wrangler
    npm run build
    cd ../../examples/workers-chat-demo
    npx wrangler dev
    # hit [x] as soon as the hotkey shortcut bar shows
    
  • #815 025c722 Thanks @threepointone! - fix: ensure that bundle is generated to es2020 target

    The default tsconfig generated by tsc uses target: "es5", which we don't support. This fix ensures that we output es2020 modules, even if tsconfig asks otherwise.

  • #349 9d04a68 Thanks @GregBrimble! - feature: Adds a --plugin option to wrangler pages functions build which compiles a Pages Plugin. More information about Pages Plugins can be found here. This wrangler build is required for both the development of, and inclusion of, plugins.
  • #822 4302172 Thanks @GregBrimble! - chore: Add help messages for wrangler pages project and wrangler pages deployment
  • #837 206b9a5 Thanks @threepointone! - polish: replace 🦺 with ⚠️

    I got some feedback that the construction worker jacket (?) icon for deprecations is confusing, especially because it's an uncommon icon and not very big in the terminal. This patch replaces it with a more familiar warning symbol.

  • #824 62af4b6 Thanks @threepointone! - feat: publish --outdir <path>

    It can be useful to introspect built assets. A leading usecase is to upload the sourcemap that we generate to services like sentry etc, so that errors from the worker can be mapped against actual source code. We introduce a --outdir cli arg to specify a path to generate built assets at, which doesn't get cleaned up after publishing. We are not adding this to wrangler.toml just yet, but could in the future if it looks appropriate there.

  • #811 8c2c7b7 Thanks @JacobMGEvans! - feat: Added minify as a configuration option and a cli arg, which will minify code for dev and publish

    resolves #785

0.0.26

Patch Changes

  • #782 34552d9 Thanks @GregBrimble! - feature: Add 'pages create project [name]' command.

    This command will create a Pages project with a given name, and optionally set its --production-branch=[production].

  • #772 a852e32 Thanks @JacobMGEvans! - fix: We want to prevent any user created code from sending Events to Sentry, which can be captured by uncaughtExceptionMonitor listener. Miniflare code can run user code on the same process as Wrangler, so we want to return null if @miniflare is present in the Event frames.
  • #778 85b0c31 Thanks @threepointone! - feat: optionally send zone_id with a route

    This enables optionally passing a route as {pattern: string, zone_id: string}. There are scenarios where we need to explicitly pass a zone_id to the api, so this enables that.

    Some nuance: The errors from the api aren't super useful when invalid values are passed, but that's something to further work on.

    This also fixes some types in our cli parsing.

    Fixes https://github.com/cloudflare/workers-sdk/issues/774

  • #806 b24aeb5 Thanks @threepointone! - fix: check for updates on the right channel

    This makes the update checker run on the channel that the version being used runs on.

  • #807 7e560e1 Thanks @threepointone! - fix: read isLegacyEnv correctly

    This fixes the signature for isLegacyEnv() since it doesn't use args, and we fix reading legacy_env correctly when creating a draft worker when creating a secret.

  • #779 664803e Thanks @threepointone! - chore: update packages

    This updates some dependencies. Some highlights -

    • updates to @iarna/toml means we can have mixed types for inline arrays, which is great for #774 / https://github.com/cloudflare/workers-sdk/pull/778
    • I also moved timeago.js to devDependencies since it already gets compiled into the bundle
    • updates to esbuild brings along a number of smaller fixes for modern js
  • #810 0ce47a5 Thanks @caass! - Make wrangler tail TTY-aware, and stop printing non-JSON in JSON mode

    Closes #493

    2 quick fixes:

    • Check process.stdout.isTTY at runtime to determine whether to default to "pretty" or "json" output for tailing.
    • Only print messages like "Connected to {worker}" if in "pretty" mode (errors still throw strings)

0.0.25

Patch Changes

  • #767 836ad59 Thanks @threepointone! - fix: use cwd for --experiment-enable-local-persistence

    This sets up --experiment-enable-local-persistence to explicitly use process.cwd() + wrangler-local-state as a path to store values. Without it, local mode uses the temp dir that we use to bundle the worker, which gets wiped out on ending wrangler dev. In the future, based on usage, we may want to make the path configurable as well.

    Fixes https://github.com/cloudflare/workers-sdk/issues/766

  • #723 7942936 Thanks @threepointone! - fix: spread tail messages when logging

    Logged messages (via console, etc) would previously be logged as an array of values. This spreads it when logging to match what is expected.

  • #728 0873049 Thanks @threepointone! - fix: only send durable object migrations when required

    We had a bug where even if you'd published a script with migrations, we would still send a blank set of migrations on the next round. The api doesn't accept this, so the fix is to not do so. I also expanded test coverage for migrations.

    Fixes https://github.com/cloudflare/workers-sdk/issues/705

  • #763 f72c943 Thanks @JacobMGEvans! - feat: Added the update check that will check the package once a day against the beta release, distTag can be changed later, then prints the latestbeta version to the user.

    resolves #762

  • #695 48fa89b Thanks @caass! - fix: stop wrangler spamming console after login

    If a user hasn't logged in and then they run a command that needs a login they'll get bounced to the login flow. The login flow (if completed) would write their shiny new OAuth2 credentials to disk, but wouldn't reload the in-memory state. This led to issues like #693, where even though the user was logged in on-disk, wrangler wouldn't be aware of it.

    We now update the in-memory login state each time new credentials are written to disk.

  • #747 db6b830 Thanks @petebacondarwin! - refactor: remove process.exit() from the pages code

    This enables simpler testing, as we do not have to spawn new child processes to avoid the process.exit() from killing the jest process.

    As part of the refactor, some of the Error classes have been moved to a shared errors.ts file.

  • #726 c4e5dc3 Thanks @threepointone! - fix: assume a worker is a module worker only if it has a default export

    This tweaks the logic that guesses worker formats to check whether a default export is defined on an entry point before assuming it's a module worker.

  • #743 ac5c48b Thanks @threepointone! - feat: implement [data_blobs]

    This implements [data_blobs] support for service-worker workers, as well as enabling Data module support for service-worker workers. data_blob is a supported binding type, but we never implemented support for it in v1. This implements support, and utilises it for supporting Data modules in service worker format. Implementation wise, it's incredibly similar to how we implemented text_blobs, with relevant changes.

    Partial fix for https://github.com/cloudflare/workers-sdk/issues/740 pending local mode support.

  • #733 91873e4 Thanks @JacobMGEvans! - polish: improved visualization of the deprecation messages between serious and warnings with emojis. This also improves the delineation between messages.
  • #738 c04791c Thanks @petebacondarwin! - fix: add support for cron triggers in dev --local mode

    Currently, I don't know if there is support for doing this in "remote" dev mode.

    Resolves #737

  • #732 c63ea3d Thanks @JacobMGEvans! - fix: abort async operations in the Remote component to avoid unwanted side-effects When the Remote component is unmounted, we now signal outstanding fetch() requests, and waitForPortToBeAvailable() tasks to cancel them. This prevents unexpected requests from appearing after the component has been unmounted, and also allows the process to exit cleanly without a delay.

    fixes #375

0.0.24

Patch Changes

  • #719 6503ace Thanks @petebacondarwin! - fix: ensure the correct worker name is published in legacy environments

    When a developer uses --env to specify an environment name, the Worker name should be computed from the top-level Worker name and the environment name.

    When the given environment name does not match those in the wrangler.toml, we error. But if no environments have been specified in the wrangler.toml, at all, then we only log a warning and continue.

    In this second case, we were reusing the top-level environment, which did not have the correct legacy environment fields set, such as the name. Now we ensure that such an environment is created as needed.

    See https://github.com/cloudflare/workers-sdk/pull/680#issuecomment-1080407556

  • #713 18d09c7 Thanks @threepointone! - fix: don't fetch zone id for wrangler dev --local

    We shouldn't try to resolve a domain/route to a zone id when starting in local mode (since there may not even be network).

  • #692 52ea60f Thanks @threepointone! - fix: do not deploy to workers.dev when routes are defined in an environment

    When workers_dev is not configured, we had a bug where it would default to true inside an environment even when there were routes defined, thus publishing both to a workers.dev subdomain as well as the defined routes. The fix is to default workers_dev to undefined, and check when publishing whether or not to publish to workers.dev/defined routes.

    Fixes https://github.com/cloudflare/workers-sdk/issues/690

  • #687 8f7ac7b Thanks @petebacondarwin! - fix: add warning about wrangler dev with remote Durable Objects

    Durable Objects that are being bound by script_name will not be isolated from the live data during development with wrangler dev. This change simply warns the developer about this, so that they can back out before accidentally changing live data.

    Fixes #319

  • #661 6967086 Thanks @JacobMGEvans! - polish: add "Beta" messaging around the CLI command for Pages. Explicitly specifying the command is Beta, not to be confused with Pages itself which is production ready.
  • #702 241000f Thanks @threepointone! - fix: setup jsx loaders when guessing worker format

    • We consider jsx to be regular js, and have setup our esbuild process to process js/mjs/cjs files as jsx.
    • We use a separate esbuild run on an entry point file when trying to guess the worker format, but hadn't setup the loaders there.
    • So if just the entrypoint file has any jsx in it, then we error because it can't parse the code.

    The fix is to add the same loaders to the esbuild run that guesses the worker format.

    Reported in https://github.com/cloudflare/workers-sdk/issues/701

  • #716 6987cf3 Thanks @threepointone! - feat: path to a custom tsconfig

    This adds a config field and a command line arg tsconfig for passing a path to a custom typescript configuration file. We don't do any typechecking, but we do pass it along to our build process so things like compilerOptions.paths get resolved correctly.

  • #665 62a89c6 Thanks @caass! - fix: validate that bindings have unique names

    We don't want to have, for example, a KV namespace named "DATA" and a Durable Object also named "DATA". Then it would be ambiguous what exactly would live at env.DATA (or in the case of service workers, the DATA global) which could lead to unexpected behavior -- and errors.

    Similarly, we don't want to have multiple resources of the same type bound to the same name. If you've been working with some KV namespace called "DATA", and you add a second namespace but don't change the binding to something else (maybe you're copying-and-pasting and just changed out the id), you could be reading entirely the wrong stuff out of your KV store.

    So now we check for those sorts of situations and throw an error if we find that we've encountered one.

  • #698 e3e3243 Thanks @threepointone! - feat: inject process.env.NODE_ENV into scripts

    An extremely common pattern in the js ecosystem is to add additional behaviour gated by the value of process.env.NODE_ENV. For example, React leverages it heavily to add dev-time checks and warnings/errors, and to load dev/production versions of code. By doing this substitution ourselves, we can get a significant runtime boost in libraries/code that leverage this.

    This does NOT tackle the additional features of either minification, or proper node compatibility, or injecting wrangler's own environment name, which we will tackle in future PRs.

  • #680 8e2cbaf Thanks @JacobMGEvans! - refactor: support backwards compatibility with environment names and related CLI flags

    1. When in Legacy environment mode we should not compute name field if specified in an environment.
    2. Throw an Error when --env and --name are used together in Legacy Environment, except for Secrets & Tail which are using a special case getLegacyScriptName for parity with Wrangler v1
    3. Started the refactor for args being utilized at the Config level, currently checking for Legacy Environment only.

    Fixes https://github.com/cloudflare/workers-sdk/issues/672

  • #684 82ec7c2 Thanks @GregBrimble! - fix: Fix --binding option for wrangler pages dev.

    We'd broken this with #581. This reverts that PR, and fixes it slightly differently. Also added an integration test to ensure we don't regress in the future.

0.0.23

Patch Changes

  • #675 e88a54e Thanks @threepointone! - fix: resolve non-js modules correctly in local mode

    In https://github.com/cloudflare/workers-sdk/pull/633, we missed passing a cwd to the process that runs the miniflare cli. This broke how miniflare resolves modules, and led back to the dreaded "path should be a path.relative()d string" error. The fix is to simply pass the cwd to the spawn call.

    Test plan:

    cd packages/wrangler
    npm run build
    cd ../workers-chat-demo
    npx wrangler dev --local
    
  • #668 3dcdb0d Thanks @petebacondarwin! - fix: tighten up the named environment configuration

    Now, when we normalize and validate the raw config, we pass in the currently active environment name, and the config that is returned contains all the environment fields correctly normalized (including inheritance) at the top level of the config object. This avoids other commands from having to check both the current named environment and the top-level config for such fields.

    Also, now, handle the case where the active environment name passed in via the --env command line argument does not match any of the named environments in the configuration:

    • This is an error if there are named environments configured;
    • or only a warning if there are no named environments configured.
  • #633 003f3c4 Thanks @JacobMGEvans! - refactor: create a custom CLI wrapper around Miniflare API

    This allows us to tightly control the options that are passed to Miniflare. The current CLI is setup to be more compatible with how Wrangler v1 works, which is not optimal for Wrangler v2.

  • #633 84c857e Thanks @JacobMGEvans! - fix: ensure asset keys are relative to the project root

    Previously, asset file paths were computed relative to the current working directory, even if we had used -c to run Wrangler on a project in a different directory to the current one.

    Now, assets file paths are computed relative to the "project root", which is either the directory containing the wrangler.toml or the current working directory if there is no config specified.

  • #662 612952b Thanks @JacobMGEvans! - bugfix: use alias -e for --env to prevent scripts using Wrangler 1 from breaking when switching to Wrangler v2.
  • #671 ef0aaad Thanks @GregBrimble! - fix: don't exit on initial Pages Functions compilation failure

    Previously, we'd exit the wrangler pages dev process if we couldn't immediately compile a Worker from the functions directory. We now log the error, but don't exit the process. This means that proxy processes can be cleaned up cleanly on SIGINT and SIGTERM, and it matches the behavior of if a compilation error is introduced once already running (we don't exit then either).

  • #640 2a2d50c Thanks @caass! - Error if the user is trying to implement DO's in a service worker

    Durable Objects can only be implemented in Module Workers, so we should throw if we detect that the user is trying to implement a Durable Object but their worker is in Service Worker format.

0.0.22

Patch Changes

  • #656 aeb0fe0 Thanks @threepointone! - fix: resolve npm modules correctly

    When implementing legacy module specifiers, we didn't throughly test the interaction when there weren't any other files next to the entry worker, and importing npm modules. It would create a Regex that matched every import, and fail because a file of that name wasn't present in the source directory. This fix constructs a better regex, applies it only when there are more files next to the worker, and increases test coverage for that scenario.

    Fixes https://github.com/cloudflare/workers-sdk/issues/655

0.0.21

Patch Changes

  • #647 f3f3907 Thanks @petebacondarwin! - feat: add support for --ip and config.dev.ip in the dev command

    Note that this change modifies the default listening address to localhost, which is different to 127.0.0.1, which is what Wrangler v1 does. For most developers this will make no observable difference, since the default host mapping in most OSes from localhost to 127.0.0.1.

    Resolves #584

0.0.20

Patch Changes

  • #599 7d4ea43 Thanks @caass! - Force-open a chromium-based browser for devtools

    We rely on Chromium-based devtools for debugging workers, so when opening up the devtools URL, we should force a chromium-based browser to launch. For now, this means checking (in order) for Chrome and Edge, and then failing if neither of those are available.

  • #567 05b81c5 Thanks @threepointone! - fix: consolidate getEntry() logic

    This consolidates some logic into getEntry(), namely including guessWorkerFormat() and custom builds. This simplifies the code for both dev and publish.

    • Previously, the implementation of custom builds inside dev assumed it could be a long running process; however it's not (else consider that publish would never work).
    • By running custom builds inside getEntry(), we can be certain that the entry point exists as we validate it and before we enter dev/publish, simplifying their internals
    • We don't have to do periodic checks inside wrangler dev because it's now a one shot build (and always should have been)
    • This expands test coverage a little for both dev and publish.
    • The 'format' of a worker is intrinsic to its contents, so it makes sense to establish its value inside getEntry()
    • This also means less async logic inside <Dev/>, which is always a good thing
  • #628 b640ab5 Thanks @caass! - Validate that if route exists in wrangler.toml, routes does not (and vice versa)
  • #591 42c2c0f Thanks @petebacondarwin! - fix: add warning about setting upstream-protocol to http

    We have not implemented setting upstream-protocol to http and currently do not intend to.

    This change just adds a warning if a developer tries to do so and provides a link to an issue where they can add their use-case.

  • #596 187264d Thanks @threepointone! - feat: support Wrangler v1.x module specifiers with a deprecation warning

    This implements Wrangler v1.x style module specifiers, but also logs a deprecation warning for every usage.

    Consider a project like so:

      project
      ├── index.js
      └── some-dependency.js
    

    where the content of index.js is:

    import SomeDependency from "some-dependency.js";
    
    addEventListener("fetch", (event) => {});
    

    wrangler 1.x would resolve import SomeDependency from "some-dependency.js"; to the file some-dependency.js. This will work in wrangler v2, but it will log a deprecation warning. Instead, you should rewrite the import to specify that it's a relative path, like so:

    - import SomeDependency from "some-dependency.js";
    + import SomeDependency from "./some-dependency.js";
    

    In a near future version, this will become a breaking deprecation and throw an error.

    (This also updates workers-chat-demo to use the older style specifier, since that's how it currently is at https://github.com/cloudflare/workers-chat-demo)

    Known issue: This might not work as expected with .js/.cjs/.mjs files as expected, but that's something to be fixed overall with the module system.

    Closes https://github.com/cloudflare/workers-sdk/issues/586

  • #559 16fb5e6 Thanks @petebacondarwin! - feat: support adding secrets in non-interactive mode

    Now the user can pipe in the secret value to the wrangler secret put command. For example:

    cat my-secret.txt | wrangler secret put secret-key --name worker-name
    

    This requires that the user is logged in, and has only one account, or that the account_id has been set in wrangler.toml.

    Fixes #170

  • #597 94c2698 Thanks @caass! - Deprecate wrangler route, wrangler route list, and wrangler route delete

    Users should instead modify their wrangler.toml or use the --routes flag when publishing to manage routes.

  • #638 06f9278 Thanks @threepointone! - polish: add a small banner for commands

    This adds a small banner for most commands. Specifically, we avoid any commands that maybe used as a parse input (like json into jq). The banner itself simply says " wrangler" with an orange underline.

  • #592 56886cf Thanks @caass! - Stop reporting breadcrumbs to sentry

    Sentry's SDK automatically tracks "breadcrumbs", which are pieces of information that get tracked leading up to an exception. This can be useful for debugging errors because it gives better insight into what happens before an error occurs, so you can more easily understand and recreate exactly what happened before an error occurred.

    Unfortunately, Sentry automatically includes all console statements. And since we use the console a lot (e.g. logging every request received in wrangler dev), this is mostly useless. Additionally, since developers frequently use the console to debug their workers we end up with a bunch of data that is not only irrelevant to the reported error, but also contains data that could be potentially sensitive.

    For now, we're turning off breadcrumbs entirely. Later, we might wish to add our own breadcrumbs manually (e.g. add a "wrangler dev" breadcrumb when a user runs wrangler dev), at which point we can selectively enable breadcrumbs to catch only the ones we've put in there ourselves.

  • #645 61aea30 Thanks @petebacondarwin! - fix: improve authentication logging and warnings

    • If a user has previously logged in via Wrangler v1 with an API token, we now display a helpful warning.
    • When logging in and out, we no longer display the path to the internal user auh config file.
    • When logging in, we now display an initial message to indicate the authentication flow is starting.

    Fixes #526

  • #608 a7fa544 Thanks @sidharthachatterjee! - fix: Ensure generateConfigFromFileTree generates config correctly for multiple splats

    Functions with multiple parameters, like /near/[latitude]/[longitude].ts wouldn't work. This fixes that.

  • #580 8013e0a Thanks @petebacondarwin! - feat: add support for --local-protocol=https to wrangler dev

    This change adds full support for the setting the protocol that the localhost proxy server listens to. Previously, it was only possible to use HTTP. But now you can set it to HTTPS as well.

    To support HTTPS, Wrangler needs an SSL certificate. Wrangler now generates a self-signed certificate, as needed, and caches it in the ~/.wrangler/local-cert directory. These certificates expire after 30 days and are regenerated by Wrangler as needed.

    Note that if you use HTTPS then your browser will complain about the self-signed and you must tell it to accept the certificate before it will let you access the page.

  • #639 5161e1e Thanks @petebacondarwin! - refactor: initialize the user auth state synchronously

    We can now initialize the user state synchronously, which means that we can remove the checks for whether it has been done or not in each of the user auth functions.

  • #568 b6f2266 Thanks @caass! - Show an actionable error message when publishing to a workers.dev subdomain that hasn't been created yet.

    When publishing a worker to workers.dev, you need to first have registered your workers.dev subdomain (e.g. my-subdomain.workers.dev). We now check to ensure that the user has created their subdomain before uploading a worker to workers.dev, and if they haven't, we provide a link to where they can go through the workers onboarding flow and create one.

  • #641 21ee93e Thanks @petebacondarwin! - fix: error if a non-legacy service environment tries to define a worker name

    Given that service environments all live off the same worker, it doesn't make sense for them to have different names.

    This change adds validation to tell the developer to remove such name fields in service environment config.

    Fixes #623

  • #621 e452a04 Thanks @petebacondarwin! - fix: stop checking for open port once it has timed out in waitForPortToBeAvailable()

    Previously, if waitForPortToBeAvailable() timed out, the checkPort() function would continue to be called. Now we clean up fully once the promise is resolved or rejected.

  • #600 1bbd834 Thanks @skirsten! - fix: use environment specific and inherited config values in publish
  • #577 7faf0eb Thanks @threepointone! - fix: config.site.entry-point as a breaking deprecation

    This makes configuring site.entry-point in config as a breaking deprecation, and throws an error. We do this because existing apps with site.entry-point won't work in v2.

  • #578 c56847c Thanks @threepointone! - fix: gracefully fail if we can't create ~/.wrangler/reporting.toml

    In some scenarios (CI/CD, docker, etc), we won't have write access to ~/.wrangler. We already don't write a configuration file there if one passes a CF_API_TOKEN/CLOUDFLARE_API_TOKEN env var. This also adds a guard when writing the error reporting configuration file.

  • #621 e452a04 Thanks @petebacondarwin! - fix: check for the correct inspector port in local dev

    Previously, the useLocalWorker() hook was being passed the wrong port for the inspectorPort prop.

    Once this was fixed, it became apparent that we were waiting for the port to become free in the wrong place, since this port is already being listened to in useInspector() by the time we were starting the check.

    Now, the check to see if the inspector port is free is done in useInspector(), which also means that Remote benefits from this check too.

  • #587 49869a3 Thanks @threepointone! - feat: expire unused assets in [site] uploads

    This expires any previously uploaded assets when using a Sites / [site] configuration. Because we currently do a full iteration of a namespace's keys when publishing, for rapidly changing sites this means that uploads get slower and slower. We can't just delete unused assets because it leads to occasional 404s on older publishes while we're publishing. So we expire previous assets while uploading new ones. The implementation/constraints of the kv api means that uploads may become slower, but should hopefully be faster overall. These optimisations also only matter for rapidly changing sites, so common usecases still have the same perf characteristics.

0.0.19

Patch Changes

  • #557 835c3ae Thanks @threepointone! - fix: wrangler dev on unnamed workers in remote mode

    With unnamed workers, we use the filename as the name of the worker, which isn't a valid name for workers because of the . (This break was introduced in https://github.com/cloudflare/workers-sdk/pull/545). The preview service accepts unnamed workers and generates a hash anyway, so the fix is to simply not send it, and use the host that the service provides.

0.0.18

Patch Changes

  • #554 18ac439 Thanks @petebacondarwin! - fix: limit bulk put API requests to batches of 5,000

    The kv:bulk put command now batches up put requests in groups of 5,000, displaying progress for each request.

  • #437 2805205 Thanks @jacobbednarz! - feat: use CLOUDFLARE_... environment variables deprecating CF_...

    Now one should use CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_BASE_URL rather than CF_API_TOKEN, CF_ACCOUNT_ID and CF_API_BASE_URL, which have been deprecated.

    If you use the deprecated variables they will still work but you will see a warning message.

    Within the Cloudflare tooling ecosystem, we have a mix of CF_ and CLOUDFLARE_ for prefixing environment variables. Until recently, many of the tools were fine with CF_ however, there started to be conflicts with external tools (such as Cloudfoundary CLI), which also uses CF_ as a prefix, and would potentially be reading and writing the same value the Cloudflare tooling.

    The Go SDK1, Terraform2 and cf-terraforming3 have made the jump to the CLOUDFLARE_ prefix for environment variable prefix.

    In future, all SDKs will use this prefix for consistency and to allow all the tooling to reuse the same environment variables in the scenario where they are present.

  • #530 fdb4afd Thanks @threepointone! - feat: implement rules config field

    This implements the top level rules configuration field. It lets you specify transport rules for non-js modules. For example, you can specify *.md files to be included as a text file with -

    [[rules]]
    {type = "Text", globs = ["**/*.md"]}
    

    We also include a default ruleset -

      { type: "Text", globs: ["**/*.txt", "**/*.html"] },
      { type: "Data", globs: ["**/*.bin"] },
      { type: "CompiledWasm", globs: ["**/*.wasm"] },
    

    More info at https://developers.cloudflare.com/workers/cli-wrangler/configuration/#build.

    Known issues -

    • non-wasm module types do not work in --local mode
    • Data type does not work in service worker format, in either mode
  • #517 201a6bb Thanks @threepointone! - fix: publish environment specific routes

    This adds some tests for publishing routes, and fixes a couple of bugs with the flow.

    • fixes publishing environment specific routes, closes https://github.com/cloudflare/workers-sdk/issues/513
    • default workers_dev to false if there are any routes specified
    • catches a hanging promise when we were toggling off a workers.dev subdomain (which should have been caught by the no-floating-promises lint rule, so that's concerning)
    • this also fixes publishing environment specific crons, but I'll write tests for that when I'm doing that feature in depth
  • #528 26f5ad2 Thanks @threepointone! - feat: top level main config field

    This implements a top level main field for wrangler.toml to define an entry point for the worker , and adds a deprecation warning for build.upload.main. The deprecation warning is detailed enough to give the exact line to copy-paste into your config file. Example -

    The `build.upload` field is deprecated. Delete the `build.upload` field, and add this to your configuration file:
    
    main = "src/chat.mjs"
    

    This also makes ./dist a default for build.upload.dir, to match Wrangler v1's behaviour.

    Closes https://github.com/cloudflare/workers-sdk/issues/488

  • #480 10cb789 Thanks @caass! - Refactored tail functionality in preparation for adding pretty printing.
    • Moved the debug toggle from a build-time constant to a (hidden) CLI flag
    • Implemented pretty-printing logs, togglable via --format pretty CLI option
    • Added stronger typing for tail event messages
  • #525 9d5c14d Thanks @threepointone! - feat: tail+envs

    This implements service environment support for wrangler tail. Fairly simple, we just generate the right URLs. wrangler tail already works for legacy envs, so there's nothing to do there.

  • #481 8874548 Thanks @threepointone! - fix: replace the word "deploy" with "publish" everywhere.

    We should be consistent with the word that describes how we get a worker to the edge. The command is publish, so let's use that everywhere.

  • #537 b978db4 Thanks @threepointone! - feat: --local mode only applies in wrangler dev

    We'd originally planned for --local mode to be a thing across all wrangler commands. In hindsight, that didn't make much sense, since every command other than wrangler dev assumes some interaction with cloudflare and their API. The only command other than dev where this "worked" was kv, but even that didn't make sense because wrangler dev wouldn't even read from it. We also have --experimental-enable-local-persistence there anyway.

    So this moves the --local flag to only apply for wrangler dev and removes any trace from other commands.

  • #518 72f035e Thanks @threepointone! - feat: implement [text_blobs]

    This implements support for [text_blobs] as defined by https://github.com/cloudflare/wrangler-legacy/pull/1677.

    Text blobs can be defined in service-worker format with configuration in wrangler.toml as -

    [text_blobs]
    MYTEXT = "./path/to/my-text.file"
    

    The content of the file will then be available as the global MYTEXT inside your code. Note that this ONLY makes sense in service-worker format workers (for now).

    Workers Sites now uses [text_blobs] internally. Previously, we were inlining the asset manifest into the worker itself, but we now attach the asset manifest to the uploaded worker. I also added an additional example of Workers Sites with a modules format worker.

  • #532 046b17d Thanks @threepointone! - feat: dev+envs

    This implements service environments + wrangler dev. Fairly simple, it just needed the right url when creating the edge preview token.

    I tested this by publishing a service under one env, adding secrets under it in the dashboard, and then trying to dev under another env, and verifying that the secrets didn't leak.

  • #552 3cee150 Thanks @petebacondarwin! - feat: add confirmation and success messages to kv:bulk delete command

    Added the following:

    • When the deletion completes, we get Success! logged to the console.
    • Before deleting, the user is now asked to confirm is that is desired.
    • A new flag --force/-f to avoid the confirmation check.
  • #533 1b3a5f7 Thanks @threepointone! - feat: default to legacy environments

    While implementing support for service environments, we unearthed a small number of usage issues. While we work those out, we should default to using regular "legacy" environments.

  • #519 93576a8 Thanks @caass! - fix: Improve port selection for wrangler dev for both worker ports and inspector ports.

    Previously when running wrangler dev on multiple workers at the same time, you couldn't attach DevTools to both workers, since they were both listening on port 9229. With this PR, that behavior is improved -- you can now pass an --inspector-port flag to specify a port for DevTools to connect to on a per-worker basis, or if the option is omitted, wrangler will assign a random unused port for you.

    This "if no option is given, assign a random unused port" behavior has also been added to wrangler dev --port, so running wrangler dev on two workers at once should now "just work". Hopefully.

  • #494 6e6c30f Thanks @caass! - - Add tests covering pretty-printing of logs in wrangler tail
    • Modify RequestEvent types
      • Change Date types to number to make parsing easier
      • Change exception and log message properties to unknown
    • Add datetime to pretty-printed request events
  • #496 5a640f0 Thanks @jahands! - chore: Remove acorn/acorn-walk dependency used in Pages Functions filepath-routing.

    This shouldn't cause any functional changes, Pages Functions filepath-routing now uses esbuild to find exports.

  • #419 04f4332 Thanks @Electroid! - refactor: use esbuild's message formatting for cleaner error messages

    This is the first step in making a standard format for error messages. For now, this uses esbuild's error formatting, which is nice and colored, but we could decide to customize our own later. Moreover, we should use the parseJSON, parseTOML, and readFile utilities so there are pretty errors for any configuration.

  • #501 824d8c0 Thanks @petebacondarwin! - refactor: delegate deprecated preview command to dev if possible

    The preview command is deprecated and not supported in this version of Wrangler. Instead, one should use the dev command for most preview use-cases.

    This change attempts to delegate any use of preview to dev failing if the command line contains positional arguments that are not compatible with dev.

    Resolves #9

  • #541 371e6c5 Thanks @threepointone! - chore: refactor some common code into requireAuth()

    There was a common chunk of code across most commands that ensures a user is logged in, and retrieves an account ID. I'd resisted making this into an abstraction for a while. Now that the codebase is stable, and https://github.com/cloudflare/workers-sdk/pull/537 removes some surrounding code there, I made an abstraction for this common code as requireAuth(). This gets a mention in the changelog simply because it touches a bunch of code, although it's mostly mechanical deletion/replacement.

  • #503 e5c7ed8 Thanks @petebacondarwin! - refact: consolidate on ws websocket library

    Removes the faye-websocket library and uses ws across the code base.

  • #502 b30349a Thanks @petebacondarwin! - fix(pages): ensure remaining args passed to pages dev command are captured

    It is common to pass additional commands to pages dev to generate the input source. For example:

    npx wrangler pages dev -- npm run dev
    

    Previously the args after -- were being dropped. This change ensures that these are captured and used correctly.

    Fixes #482

  • #512 b093df7 Thanks @threepointone! - feat: a better tsconfig.json

    This makes a better tsconfig.json when using wrangler init. Of note, it takes the default tsconfig.json generated by tsc --init, and adds our modifications.

  • #510 9534c7f Thanks @threepointone! - feat: --legacy-env cli arg / legacy_env config

    This is the first of a few changes to codify how we do environments in wrangler2, both older legacy style environments, and newer service environments. Here, we add a cli arg and a config field for specifying whether to enable/disable legacy style environments, and pass it on to dev/publish commands. We also fix how we were generating kv namespaces for Workers Sites, among other smaller fixes.

  • #549 3d2ce01 Thanks @petebacondarwin! - fix: kv:bulk should JSON encode its contents

    The body passed to kv:bulk delete and kv:bulk put must be JSON encoded. This change fixes that and adds some tests to prove it.

    Fixes #547

  • #554 6e5319b Thanks @petebacondarwin! - fix: limit bulk delete API requests to batches of 5,000

    The kv:bulk delete command now batches up delete requests in groups of 5,000, displaying progress for each request.

  • #538 4b6c973 Thanks @threepointone! - feat: with wrangler init, create a new directory for named workers

    Currently, when creating a new project, we usually first have to create a directory before running wrangler init, since it defaults to creating the wrangler.toml, package.json, etc in the current working directory. This fix introduces an enhancement, where using the wrangler init [name] form creates a directory named [name] and initialises the project files inside it. This matches the usage pattern a little better, and still preserves the older behaviour when we're creating a worker inside existing projects.

  • #548 e3cab74 Thanks @petebacondarwin! - refactor: clean up unnecessary async functions

    The readFile() and readConfig() helpers do not need to be async. Doing so just adds complexity to their call sites.

  • #529 9d7e946 Thanks @petebacondarwin! - feat: add more comprehensive config validation checking

    The configuration for a Worker is complicated since we can define different "environments", and each environment can have its own configuration. There is a default ("top-level") environment and then named environments that provide environment specific configuration.

    This is further complicated by the fact that there are three kinds of environment configuration:

    • non-overridable: these values are defined once in the top-level configuration, apply to all environments and cannot be overridden by an environment.
    • inheritable: these values can be defined at the top-level but can also be overridden by environment specific values. Named environments do not need to provide their own values, in which case they inherit the value from the top-level.
    • non-inheritable: these values must be explicitly defined in each environment if they are defined at the top-level. Named environments do not inherit such configuration and must provide their own values.

    All configuration values in wrangler.toml are optional and will receive a default value if not defined.

    This change adds more strict interfaces for top-level Config and Environment types, as well as validation and normalization of the optional fields that are read from wrangler.toml.

  • #486 ff8c9f6 Thanks @threepointone! - fix: remove warning if worker with a durable object doesn't have a name

    We were warning if you were trying to develop a durable object with an unnamed worker. Further, the internal api would actually throw if you tried to develop with a named worker if it wasn't already published. The latter is being fixed internally and should live soon, and this fix removes the warning completely.

0.0.17

Patch Changes

  • #414 f30426f Thanks @petebacondarwin! - fix: support build.upload.dir when using build.upload.main

    Although, build.upload.dir is deprecated, we should still support using it when the entry-point is being defined by the build.upload.main and the format is modules.

    Fixes #413

  • #447 2c5c934 Thanks @threepointone! - fix: Config should be resolved relative to the entrypoint

    During dev and publish, we should resolve wrangler.toml starting from the entrypoint, and then working up from there. Currently, we start from the directory from which we call wrangler, this changes that behaviour to start from the entrypoint instead.

    (To implement this, I made one big change: Inside commands, we now have to explicitly read configuration from a path, instead of expecting it to 'arrive' coerced into a configuration object.)

  • #472 804523a Thanks @JacobMGEvans! - bugfix: Replace .destroy() on faye-websockets with .close() added: Interface to give faye same types as compliant ws with additional .pipe() implementation; .on("message" => fn)
  • #462 a173c80 Thanks @caass! - Add filtering to wrangler tail, so you can now wrangler tail <name> --status ok, for example. Supported options:
    • --status cancelled --status error --> you can filter on ok, error, and cancelled to only tail logs that have that status
    • --header X-CUSTOM-HEADER:somevalue --> you can filter on headers, including ones that have specific values ("somevalue") or just that contain any header (e.g. --header X-CUSTOM-HEADER with no colon)
    • --method POST --method PUT --> filter on the HTTP method used to trigger the worker
    • --search catch-this --> only shows messages that contain the phrase "catch-this". Does not (yet!) support regular expressions
    • --ip self --ip 192.0.2.232 --> only show logs from requests that originate from the given IP addresses. "self" will be replaced with the IP address of the computer that sent the tail request.
  • #471 21cde50 Thanks @caass! - Add tests for wrangler tail:
    • ensure the correct API calls are made
    • ensure that filters are sent
    • ensure that the correct filters are sent
    • ensure that JSON gets spat out into the terminal
  • #398 40d9553 Thanks @threepointone! - feat: guess-worker-format

    This formalises the logic we use to "guess"/infer what a worker's format is - either "modules" or "service worker". Previously we were using the output of the esbuild process metafile to infer this, we now explicitly do so in a separate step (esbuild's so fast that it doesn't have any apparent performance hit, but we also do a simpler form of the build to get this information).

    This also adds --format as a command line arg for publish.

  • #438 64d62be Thanks @Electroid! - feat: Add support for "json" bindings

    Did you know? We have support for "json" bindings! Here are a few examples:

    [vars] text = "plain ol' string" count = 1 complex = { enabled = true, id = 123 }

  • #411 a52f0e0 Thanks @ObsidianMinor! - feat: unsafe-bindings

    Adds support for "unsafe bindings", that is, bindings that aren't supported by wrangler, but are desired when uploading a Worker to Cloudflare. This allows you to use beta features before official support is added to wrangler, while also letting you migrate to proper support for the feature when desired. Note: these bindings may not work everywhere, and may break at any time.

  • #415 d826f5a Thanks @threepointone! - fix: don't crash when browser windows don't open

    We open browser windows for a few things; during wrangler dev, and logging in. There are environments where this doesn't work as expected (like codespaces, stackblitz, etc). This fix simply logs an error instead of breaking the flow. This is the same fix as https://github.com/cloudflare/workers-sdk/pull/263, now applied to the rest of wrangler.

  • 91d8994 Thanks @Mexican-Man! - fix: do not merge routes with different methods when computing pages routes

    Fixes #92

  • #474 bfedc58 Thanks @JacobMGEvans! - bugfix: create reporting.toml file in "wrangler/config" and move error reporting user decisions to new reporting.toml
  • #445 d5935e7 Thanks @threepointone! - chore: remove experimental_services from configuration

    Now that we have [[unsafe.bindings]] (as of https://github.com/cloudflare/workers-sdk/pull/411), we should use that for experimental features. This removes support for [experimental_services], and adds a helpful message for how to rewrite their configuration.

    This error is temporary, until the internal teams that were using this rewrite their configs. We'll remove it before GA.

    What the error looks like -

    Error: The "experimental_services" field is no longer supported. Instead, use [[unsafe.bindings]] to enable experimental features. Add this to your wrangler.toml:
    
    [[unsafe.bindings]]
    name = "SomeService"
    type = "service"
    service = "some-service"
    environment = "staging"
    
    [[unsafe.bindings]]
    name = "SomeOtherService"
    type = "service"
    service = "some-other-service"
    environment = "qa"
    
  • #456 b5f42c5 Thanks @threepointone! - chore: enable strict in tsconfig.json

    In the march towards full strictness, this enables strict in tsconfig.json and fixes the errors it pops up. A changeset is included because there are some subtle code changes, and we should leave a trail for them.

  • #448 b72a111 Thanks @JacobMGEvans! - feat: add --yes with alias --y flag as automatic answer to all prompts and run wrangler init non-interactively. generated during setup:
    • package.json
    • TypeScript, which includes tsconfig.json & @cloudflare/workers-types
    • Template "hello world" Worker at src/index.ts
  • #403 f9fef8f Thanks @JacobMGEvans! - feat: add scripts to package.json & autogenerate name value when initializing a project To get wrangler init projects up and running with good ergonomics for deploying and development, added default scripts "start" & "deploy" with assumed TS or JS files in generated ./src/index. The name property is now derived from user input on init <name> or parent directory if no input is provided.
  • #452 1cf6701 Thanks @petebacondarwin! - feat: add support for publishing workers with r2 bucket bindings

    This change adds the ability to define bindings in your wrangler.toml file for R2 buckets. These buckets will then be available in the environment passed to the worker at runtime.

    Closes #365

  • #458 a8f97e5 Thanks @petebacondarwin! - fix: do not publish to workers.dev if workers_dev is false

    Previously we always published to the workers.dev subdomain, ignoring the workers_dev setting in the wrangler.toml configuration.

    Now we respect this configuration setting, and also disable an current workers.dev subdomain worker when we publish and workers_dev is false.

    Fixes #410

  • #457 b249e6f Thanks @threepointone! - fix: don't report intentional errors

    We shouldn't be reporting intentional errors, only exceptions. This removes reporting for all caught errors for now, until we filter all known errors, and then bring back reporting for unknown errors. We also remove a stray console.warn().

  • #402 5a9bb1d Thanks @JacobMGEvans! - feat: Added Wrangler TOML fields Additional field to get projects ready to publish as soon as possible. It will check if the Worker is named, if not then it defaults to using the parent directory name.
  • #227 97e15f5 Thanks @JacobMGEvans! - feature: Sentry Integration Top level exception logging which will allow to Pre-empt issues, fix bugs faster, Identify uncommon error scenarios, and better quality error information. Context includes of Error in addition to stacktrace Environment: OS/arch node/npm versions wrangler version RewriteFrames relative pathing of stacktrace and will prevent user file system information from being sent.

    Sourcemaps:

    • The sourcemap custom scripts for path matching in Artifact, Sentry Event and Build output is moved to be handled in GH Actions Sentry upload moved after changeset version bump script and npm script to get current version into GH env variable
    • Add org and project to secrets for increased obfuscation of Cloudflare internal ecosystem

    Prompt for Opt-In:

    • When Error is thrown user will be prompted with yes (only sends this time), Always, and No (default). Always and No will be added to default.toml with a datetime property for future update checks.
    • If the property already exists it will skip the prompt.

    Sentry Tests: The tests currently check that the decision flow works as currently set up then checks if Sentry is able to send events or is disabled.

  • #427 bce731a Thanks @petebacondarwin! - refactor: share worker bundling between both publish and dev commands

    This changes moves the code that does the esbuild bundling into a shared file and updates the publish and dev to use it, rather than duplicating the behaviour.

    See #396 Resolves #401

  • #458 c0cfd60 Thanks @petebacondarwin! - fix: pass correct query param when uploading a script

    In f9c1423f0c5b6008f05b9657c9b84eb6f173563a the query param was incorrectly changed from available_on_subdomain to available_on_subdomains.

  • #409 f8bb523 Thanks @threepointone! - feat: support [wasm_modules] for service-worker format workers

    This lands support for [wasm_modules] as defined by https://github.com/cloudflare/wrangler-legacy/pull/1677.

    wasm modules can be defined in service-worker format with configuration in wrangler.toml as -

    [wasm_modules]
    MYWASM = "./path/to/my-wasm.wasm"
    

    The module will then be available as the global MYWASM inside your code. Note that this ONLY makes sense in service-worker format workers (for now).

    (In the future, we MAY enable wasm module imports in service-worker format (i.e. import MYWASM from './path/to/my-wasm.wasm') and global imports inside modules format workers.)

  • #423 dd9058d Thanks @petebacondarwin! - feat: add support for managing R2 buckets

    This change introduces three new commands, which manage buckets under the current account:

    • r2 buckets list: list information about all the buckets.
    • r2 buckets create: create a new bucket - will error if the bucket already exists.
    • r2 buckets delete: delete a bucket.

    This brings Wrangler 2 inline with the same features in Wrangler v1.

0.0.16

Patch Changes

  • #364 3575892 Thanks @threepointone! - enhance: small tweaks to wrangler init
    • A slightly better package.json
    • A slightly better tsconfig.json
    • installing typescript as a dev dependency
  • #380 aacd1c2 Thanks @GregBrimble! - fix: ensure pages routes are defined correctly

    In e151223 we introduced a bug where the RouteKey was now an array rather than a simple URL string. When it got stringified into the routing object these were invalid. E.g. [':page*', undefined] got stringified to ":page*," rather than ":page*".

    Fixes #379

  • #329 27a1f3b Thanks @petebacondarwin! - ci: run PR jobs on both Ubuntu, MacOS and Windows
    • update .gitattributes to be consistent on Windows
    • update Prettier command to ignore unknown files Windows seems to be more brittle here.
    • tighten up eslint config Windows seems to be more brittle here as well.
    • use the matrix.os value in the cache key Previously we were using running.os but this appeared not to be working.
  • #347 ede5b22 Thanks @threepointone! - fix: hide wrangler pages functions in the main help menu

    This hides wrangler pages functions in the main help menu, since it's only intended for internal usage right now. It still "works", so nothing changes in that regard. We'll bring this back when we have a broader story in wrangler for functions.

  • #373 6e7baf2 Thanks @petebacondarwin! - fix: use the appropriate package manager when initializing a wrangler project

    Previously, when we initialized a project using wrangler init, we always used npm as the package manager.

    Now we check to see whether npm and yarn are actually installed, and also whether there is already a lock file in place before choosing which package manager to use.

    Fixes #353

  • #363 0add2a6 Thanks @threepointone! - fix: support uppercase hotkeys in wrangler dev

    Just a quick fix to accept uppercase hotkeys during dev.

  • #331 e151223 Thanks @petebacondarwin! - fix: generate valid URL route paths for pages on Windows

    Previously route paths were manipulated by file-system path utilities. On Windows this resulted in URLs that had backslashes, which are invalid for such URLs.

    Fixes #51 Closes #235 Closes #330 Closes #327

  • #338 e0d2f35 Thanks @threepointone! - feat: environments for Worker Sites

    This adds environments support for Workers Sites. Very simply, it uses a separate kv namespace that's indexed by the environment name. This PR also changes the name of the kv namespace generated to match Wrangler v1's implementation.

  • #329 e1d2198 Thanks @petebacondarwin! - test: support testing in CI on Windows

    • Don't rely on bash variables to configure tests The use of bash variables in the npm test script is not supported in Windows Powershell, causing CI on Windows to fail. These bash variables are used to override the API token and the Account ID.

      This change moves the control of mocking these two concepts into the test code, by adding mockAccountId() and mockApiToken() helpers.

      • The result is slightly more boilerplate in tests that need to avoid hitting the auth APIs.
      • But there are other tests that had to revert these environment variables. So the boilerplate is reduced there.
    • Sanitize command line for snapshot tests This change applies normalizeSlashes() and trimTimings() to command line outputs and error messages to avoid inconsistencies in snapshots. The benefit here is that authors do not need to keep adding them to all their snapshot tests.

    • Move all the helper functions into their own directory to keep the test directory cleaner.

  • #343 cfd8ba5 Thanks @threepointone! - chore: update esbuild

    Update esbuild to 0.14.14. Also had to change import esbuild from "esbuild"; to import * as esbuild from "esbuild"; in dev.tsx.

  • #371 85ceb84 Thanks @nrgnrg! - fix: pages advanced mode usage

    Previously in pages projects using advanced mode (a single _worker.js or --script-path file rather than a ./functions folder), calling pages dev would quit without an error and not launch miniflare.

    This change fixes that and enables pages dev to be used with pages projects in advanced mode.

  • #329 ac168f4 Thanks @petebacondarwin! - refactor: use helpers to manage npm commands

    This change speeds up tests and avoids us checking that npm did what it is supposed to do.

  • #348 b8e3b01 Thanks @threepointone! - chore: replace node-fetch with undici

    There are several reasons to replace node-fetch with undici:

    • undici's fetch() implementation is set to become node's standard fetch() implementation, which means we can just remove the dependency in the future (or optionally load it depending on which version of node is being used)
    • node-fetch pollutes the global type space with a number of standard types
    • we already bundle undici via miniflare/pages, so this means our bundle size could ostensibly become smaller.

    This replaces node-fetch with undici.

    • All instances of import fetch from "node-fetch" are replaced with import {fetch} from "undici"
    • undici also comes with spec compliant forms of FormData and File, so we could also remove formdata-node in form_data.ts
    • All the global types that were injected by node-fetch are now imported from undici (as well as some mistaken ones from node:url)
    • NOTE: this also turns on skipLibCheck in tsconfig.json. Some dependencies oddly depend on browser globals like Request, Response (like @miniflare/core, jest-fetch-mock, etc), which now fail because node-fetch isn't injecting those globals anymore. So we enable skipLibCheck to bypass them. (I'd thought skipLibCheck completely ignores 'third party' types, but that's not true - it still uses the module graph to scan types. So we're still typesafe. We should enable strict sometime to avoid anys, but that's for later.)
    • The bundle size isn't smaller because we're bundling 2 different versions of undici, but we'll fix that by separately upping the version of undici that miniflare bundles.
  • #357 41cfbc3 Thanks @threepointone! - chore: add eslint-plugin-import

    • This adds eslint-plugin-import to enforce ordering of imports, and configuration for the same in package.json.
    • I also run npm run check:lint -- --fix to apply the configured order in our whole codebase.
    • This also needs a setting in .vscode/settings.json to prevent spurious warnings inside vscode. You'll probably have to restart your IDE for this to take effect. (re: https://github.com/import-js/eslint-plugin-import/issues/2377#issuecomment-1024800026)

    (I'd also like to enforce using node: prefixes for node builtin modules, but that can happen later. For now I manually added the prefixes wherever they were missing. It's not functionally any different, but imo it helps the visual grouping.)

  • #384 8452485 Thanks @petebacondarwin! - refactor: use xxhash-wasm for better compatibility with Windows

    The previous xxhash package we were using required a build step, which relied upon tooling that was not always available on Window.

    This version is a portable WASM package.

  • #334 536c7e5 Thanks @threepointone! - feat: wasm support for local mode in wrangler dev

    This adds support for *.wasm modules into local mode for wrangler dev.

    In 'edge' mode, we create a javascript bundle, but wasm modules are uploaded to the preview server directly when making the worker definition form upload. However, in 'local' mode, we need to have the actual modules available to the bundle. So we copy the files over to the bundle path. We also pass appropriate --modules-rule directive to miniflare.

    I also added a sample wasm app to use for testing, created from a default workers-rs project.

    Fixes https://github.com/cloudflare/workers-sdk/issues/299

  • #329 b8a3e78 Thanks @petebacondarwin! - ci: use npm ci and do not cache workspace packages in node_modules

    Previously we were caching all the node_modules files in the CI jobs and then running npm install. While this resulted in slightly improved install times on Ubuntu, it breaks on Windows because the npm workspace setup adds symlinks into node_modules, which the Github cache action cannot cope with.

    This change removes the node_modules caches (saving some time by not needing to restore them) and replaces npm install with npm ci.

    The npm ci command is actually designed to be used in CI jobs as it only installs the exact versions specified in the package-lock.json file, guaranteeing that for any commit we always have exactly the same CI job run, deterministically.

    It turns out that, on Ubuntu, using npm ci makes very little difference to the installation time (~30 secs), especially if there is no node_modules there in the first place.

    Unfortunately, MacOS is slower (~1 min), and Windows even worse (~2 mins)! But it is worth this longer CI run to be sure we have things working on all OSes.

0.0.15

Patch Changes

  • #333 6320a32 Thanks @threepointone! - fix: pass worker name to syncAssets in dev

    This fix passes the correct worker name to syncAssets during wrangler dev. This function uses the name to create the backing kv store for a Workers Sites definition, so it's important we get the name right.

    I also fixed the lint warning introduced in https://github.com/cloudflare/workers-sdk/pull/321, to pass props.enableLocalPersistence as a dependency in the useEffect call that starts the "local" mode dev server.

  • #335 a417cb0 Thanks @threepointone! - fix: prevent infinite loop when fetching a list of results

    When fetching a list of results from cloudflare APIs (e.g. when fetching a list of keys in a kv namespace), the api returns a cursor that a consumer should use to get the next 'page' of results. It appears this cursor can also be a blank string (while we'd only account for it to be undefined). By only accounting for it to be undefined, we were infinitely looping through the same page of results and never terminating. This PR fixes it by letting it be a blank string (and null, for good measure)

  • #332 a2155c1 Thanks @threepointone! - fix: wait for port to be available before creating a dev server

    When we run wrangler dev, we start a server on a port (defaulting to 8787). We do this separately for both local and edge modes. However, when switching between the two with the l hotkey, we don't 'wait' for the previous server to stop before starting the next one. This can crash the process, and we don't want that (of course). So we introduce a helper function waitForPortToBeAvailable() that waits for a port to be available before returning. This is used in both the local and edge modes, and prevents the bug right now, where switching between edge - local - edge crashes the process.

    (This isn't a complete fix, and we can still cause errors by very rapidly switching between the two modes. A proper long term fix for the future would probably be to hoist the proxy server hook above the <Remote/> and <Local/> components, and use a single instance throughout. But that requires a deeper refactor, and isn't critical at the moment.)

  • #336 ce61000 Thanks @threepointone! - feat: inline text-like files into the worker bundle

    We were adding text-like modules (i.e. .txt, .html and .pem files) as separate modules in the Worker definition, but this only really 'works' with the ES module Worker format. This commit changes that to inline the text-like files into the Worker bundle directly.

    We still have to do something similar with .wasm modules, but that requires a different fix, and we'll do so in a subsequent commit.

  • #336 ce61000 Thanks @threepointone! - feat: Sites support for local mode wrangler dev

    This adds support for Workers Sites in local mode when running wrangler dev. Further, it fixes a bug where we were sending the __STATIC_CONTENT_MANIFEST definition as a separate module even with service worker format, and a bug where we weren't uploading the namespace binding when other kv namespaces weren't present.

0.0.14

Patch Changes

  • #307 53c6318 Thanks @threepointone! - feat: wrangler secret * --local

    This PR implements wrangler secret for --local mode. The implementation is simply a no-op, since we don't want to actually write secret values to disk (I think?). I also got the messaging for remote mode right by copying from Wrangler v1. Further, I added tests for all the wrangler secret commands.

  • #324 b816333 Thanks @GregBrimble! - Fixes wrangler pages dev failing to start for just a folder of static assets (no functions)
  • #317 d6ef61a Thanks @threepointone! - fix: restart the dev proxy server whenever it closes

    When we run wrangler dev, the session that we setup with the preview endpoint doesn't last forever, it dies after ignoring it for 5-15 minutes or so. The fix for this is to simply reconnect the server. So we use a state hook as a sigil, and add it to the dependency array of the effect that sets up the server, and simply change it every time the server closes.

    Fixes https://github.com/cloudflare/workers-sdk/issues/197

    (In Wrangler v1, we used to restart the whole process, including uploading the worker again, making a new preview token, and so on. It looks like that they may not have been necessary.)

  • #312 77aa324 Thanks @threepointone! - fix: remove --prefer-offline when running npm install

    We were using --prefer-offline when running npm install during wrangler init. The behaviour is odd, it doesn't seem to fetch from the remote when the cache isn't hit, which is not what I'm expecting. So we remove --prefer-offline.

  • #311 a5537f1 Thanks @threepointone! - fix: custom builds should allow multiple commands

    We were running custom builds as a regular command with execa. This would fail whenever we tried to run compound commands like cargo install -q worker-build && worker-build --release (via https://github.com/cloudflare/workers-sdk/issues/236). The fix is to use shell: true, so that the command is run in a shell and can thus use bash-y syntax like &&, and so on. I also switched to using execaCommand which splits a command string into parts correctly by itself.

  • #321 5b64a59 Thanks @geelen! - fix: disable local persistence by default & add --experimental-enable-local-persistence flag

    BREAKING CHANGE:

    When running dev locally any data stored in KV, Durable Objects or the cache are no longer persisted between sessions by default.

    To turn this back on add the --experimental-enable-local-persistence at the command line.

0.0.13

Patch Changes

  • #293 71b0fab Thanks @petebacondarwin! - fix: warn if the site.entry-point configuration is found during publishing

    Also updates the message and adds a test for the error when there is no entry-point specified.

    Fixes #282

  • #304 7477b52 Thanks @threepointone! - feat: enhance wrangler init

    This PR adds some enhancements/fixes to the wrangler init command.

    • doesn't overwrite wrangler.toml if it already exists
    • installs wrangler when creating package.json
    • offers to install wrangler into package.json even if package.json already exists
    • offers to install @cloudflare/workers-types even if tsconfig.json already exists
    • pipes stdio back to the terminal so there's feedback when it's installing npm packages

    This does have the side effect of making out tests slower. I added --prefer-offline to the npm install calls to make this a shade quicker, but I can't figure out a good way of mocking these. I'll think about it some more later. We should work on making the installs themselves quicker (re: https://github.com/cloudflare/workers-sdk/issues/66)

    This PR also fixes a bug with our tests - runWrangler would catch thrown errors, and if we didn't manually verify the error, tests would pass. Instead, it now throws correctly, and I modified all the tests to assert on thrown errors. It seems like a lot, but it was just mechanical rewriting.

  • #294 7746fba Thanks @threepointone! - feature: add more types that get logged via console methods

    This PR adds more special logic for some data types that get logged via console methods. Types like Promise, Date, WeakMaps, and some more, now get logged correctly (or at least, better than they used to).

    This PR also fixes a sinister bug - the type of the ConsoleAPICalled events don't match 1:1 with actual console methods (eg: console.warn message type is warning). This PR adds a mapping between those types and method names. Some methods don't seem to have a message type, I'm not sure why, but we'll get to them later.

  • #310 52c99ee Thanks @threepointone! - feat: error if a site definition doesn't have a bucket field

    This adds an assertion error for making sure a [site] definition always has a bucket field.As a cleanup, I made some small fixes to the Config type definition, and modified the tests in publish.test.ts to use the config format when creating a wrangler.toml file.

0.0.12

Patch Changes

  • #292 e5d3690 Thanks @threepointone! - fix: use entrypoint specified in esbuuild's metafile as source for building the worker

    When we pass a non-js file as entry to esbuild, it generates a .js file. (which, is the whole job of esbuild, haha). So, given <source>/index.ts, it'll generate <destination>/index.js. However, when we try to 'find' the matching file to pass on as an input to creating the actual worker, we try to use the original file name inside the destination directory. At this point, the extension has changed, so it doesn't find the file, and hence we get the error that looks like ENOENT: no such file or directory, open '/var/folders/3f/fwp6mt7n13bfnkd5vl3jmh1w0000gp/T/tmp-61545-4Y5kwyNI8DGU/src/worker.ts'

    The actual path to the destination file is actually the key of the block in metafile.outputs that matches the given output.entryPoint, so this PR simply rewrites the logic to use that instead.

  • #287 b63efe6 Thanks @threepointone! - fix: propagate api errors to the terminal correctly

    Any errors embedded in the response from the Cloudflare API were being lost, because fetchInternal() would throw on a non-200 response. This PR fixes that behaviour:

    • It doesn't throw on non-200 responses
    • It first gets the response text with .text() and converts it to an object with JSON.parse, so in case the api returns a non json response, we don't lose response we were sent.

    Unfortunately, because of the nature of this abstraction, we do lose the response status code and statusText, but maybe that's acceptable since we have richer error information in the payload. I considered logging the code and text to the terminal, but that may make it noisy.

0.0.11

Patch Changes

  • #267 e22f9d7 Thanks @petebacondarwin! - refactor: tidy up the typings of the build result in dev

    In #262 some of the strict null fixes were removed to resolve a regression. This refactor re-applies these fixes in a way that avoids that problem.

  • #270 0289882 Thanks @petebacondarwin! - fix: ensure kv:key list matches the output from Wrangler v1

    The previous output was passing an array of objects to console.log, which ended up showing something like

    [Object object]
    [Object object]
    ...
    

    Now the result is JSON stringified before being sent to the console. The tests have been fixed to check this too.

  • #258 f9c1423 Thanks @petebacondarwin! - fix: correctly handle entry-point path when publishing

    The publish command was failing when the entry-point was specified in the wrangler.toml file and the entry-point imported another file.

    This was because we were using the metafile.inputs to guess the entry-point file path. But the order in which the source-files were added to this object was not well defined, and so we could end up failing to find a match.

    This fix avoids this by using the fact that the metadata.outputs object will only contain one element that has the entrypoint property - and then using that as the entry-point path. For runtime safety, we now assert that there cannot be zero or multiple such elements.

  • #275 e9ab55a Thanks @petebacondarwin! - feat: add a link to create a github issue when there is an error.

    When a (non-yargs) error surfaces to the top level, we know also show a link to Github to encourage the developer to report an issue.

  • #286 b661dd0 Thanks @dependabot! - chore: Update node-fetch to 3.1.1, run npm audit fix in root

    This commit addresses a secutity issue in node-fetch and updates it to 3.1.1. I also ran npm audit fix in the root directory to address a similar issue with @changesets/get-github-info.

  • #249 9769bc3 Thanks @petebacondarwin! - Do not crash when processing environment configuration.

    Previously there were corner cases where the configuration might just crash. These are now handled more cleanly with more appropriate warnings.

  • #272 5fcef05 Thanks @petebacondarwin! - refactor: enable TypeScript strict-null checks

    The codebase is now strict-null compliant and the CI checks will fail if a PR tries to introduce code that is not.

  • #277 6cc9dde Thanks @petebacondarwin! - fix: align publishing sites asset keys with Wrangler v1
    • Use the same hashing strategy for asset keys (xxhash64)
    • Include the full path (from cwd) in the asset key
    • Match include and exclude patterns against full path (from cwd)
    • Validate that the asset key is not over 512 bytes long
  • #270 522d1a6 Thanks @petebacondarwin! - fix: check actual asset file size, not base64 encoded size

    Previously we were checking whether the base64 encoded size of an asset was too large (>25MiB). But base64 takes up more space than a normal file, so this was too aggressive.

  • #263 402c77d Thanks @jkriss! - fix: appropriately fail silently when the open browser command doesn't work
  • #280 f19dde1 Thanks @petebacondarwin! - fix: skip unwanted files and directories when publishing site assets

    In keeping with Wrangler v1, we now skip node_modules and hidden files and directories.

    An exception is made for .well-known. See https://datatracker.ietf.org/doc/html/rfc8615.

    The tests also prove that the asset uploader will walk directories in general.

  • #258 ba6fc9c Thanks @petebacondarwin! - chore: add test-watch script to the wrangler workspace

    Watch the files in the wrangler workspace, and run the tests when anything changes:

    > npm run test-watch -w wrangler
    

    This will also run all the tests in a single process (rather than in parallel shards) and will increase the test-timeout to 50 seconds, which is helpful when debugging.

0.0.10

Patch Changes

0.0.9

Patch Changes

  • #238 65f9904 Thanks @threepointone! - refactor: simplify and document config.ts

    This PR cleans up the type definition for the configuration object, as well as commenting the hell out of it. There are no duplicate definitions, and I annotated what I could.

    • @optional means providing a value isn't mandatory
    • @deprecated means the field itself isn't necessary anymore in wrangler.toml
    • @breaking means the deprecation/optionality is a breaking change from Wrangler v1
    • @todo means there's more work to be done (with details attached)
    • @inherited means the field is copied to all environments
  • #257 00e51cd Thanks @threepointone! - fix: description for kv:bulk delete <filename>

    The description for the kv:bulk delete command was wrong, it was probably copied earlier from the kv:bulk put command. This PR fixes the mistake.

0.0.8

Patch Changes

  • #231 18f8f65 Thanks @threepointone! - refactor: proxy/preview server

    This PR refactors how we setup the proxy server between the developer and the edge preview service during wrangler dev. Of note, we start the server immediately. We also buffer requests/streams and hold on to them, when starting/refreshing the token. This means a developer should never see ERR_CONNECTION_REFUSED error page, or have an older worker respond after making a change to the code. And when the token does get refreshed, we flush said streams/requests with the newer values, making the iteration process a lot smoother and predictable.

  • #208 fe4b099 Thanks @petebacondarwin! - Remove explicit any types from the codebase

    This change removes all use of any from the code and updates the no-explicit-any eslint rule to be an error.

  • #223 a979d55 Thanks @GregBrimble! - Add ability to compile a directory other than functions for wrangler pages functions build.
  • #196 fc112d7 Thanks @jgentes! - allow specifying only "index" without extension or nothing at all for "wrangler dev" and "wrangler publish"
  • #211 3bbfd4f Thanks @GregBrimble! - Silently fail to auto-open the browser in wrangler pages dev command when that errors out.
  • #189 2f7e1b2 Thanks @petebacondarwin! - Refactor raw value extraction from Cloudflare APIs

    Most API responses are JSON of the form:

    { result, success, errors, messages, result_info }
    

    where the result contains the actual response value.

    But some API responses only contain the result value.

    This change refactors the client-side fetch API to allow callers to specify what kind of response they expect.

  • #215 41d4c3e Thanks @threepointone! - Add --compatibility-date, --compatibility-flags, --latest cli arguments to dev and publish.
    • A cli arg for adding a compatibility data, e.g --compatibility_date 2022-01-05
    • A shorthand --latest that sets compatibility_date to today's date. Usage of this flag logs a warning.
    • latest is NOT a config field in wrangler.toml.
    • In dev, when a compatibility date is not available in either wrangler.toml or as a cli arg, then we default to --latest.
    • In publish we error if a compatibility date is not available in either wrangler.toml or as a cli arg. Usage of --latest logs a warning.
    • We also accept compatibility flags via the cli, e.g: --compatibility-flags formdata_parser_supports_files
  • #210 d381fed Thanks @GregBrimble! - Expose wrangler pages functions build command, which takes the functions folder and compiles it into a single Worker.

    This was already done in wrangler pages dev, so this change just exposes this build command for use in our build image, or for people who want to do it themselves.

  • #213 5e1222a Thanks @GregBrimble! - Adds support for building a Worker from a folder of functions which isn't tied to the Pages platform.

    This lets developers use the same file-based routing system an simplified syntax when developing their own Workers!

  • #199 d9ecb70 Thanks @threepointone! - Refactor inspection/debugging code -
    • I've installed devtools-protocol, a convenient package that has the static types for the devtools protocol (duh) autogenerated from chrome's devtools codebase.
    • We now log messages and exceptions into the terminal directly, so you don't have to open devtools to see those messages.
    • Messages are now buffered until a devtools instance connects, so you won't lose any messages while devtools isn't connected.
    • We don't lose the connection on making changes to the worker, removing the need for the kludgy hack on the devtools side (where we refresh the whole page when there's a change)
  • #189 2f7e1b2 Thanks @petebacondarwin! - Fix pagination handling of list requests to the Cloudflare API

    When doing a list request to the API, the server may respond with only a single page of results. In this case, it will also provide a cursor value in the result_info part of the response, which can be used to request the next page. This change implements this on the client-side so that we get all the results by requesting further pages when there is a cursor.

  • #220 6fc2276 Thanks @GregBrimble! - Add --live-reload option to wrangler pages dev which automatically reloads HTML pages when a change is detected
  • #223 a979d55 Thanks @GregBrimble! - Add --output-config-path option to wrangler pages functions build which writes a config file describing the functions folder.

0.0.7

Patch Changes

  • 1fdcfe3: Subfolder Relative Pathing Fix issue #147 The filename from args didn't handle relative paths passed in from users with scripts in subfolders. To handle the subfolder pathing a path.relative using cwd() to user input filepath to the filepath variable passed into Dev

  • 0330ecf: Adds the Content-Type header when serving assets with wrangler pages dev. It guesses the mime-type based on the asset's file extension.

  • eaf40e8: Improve the error message for bad kv:namespace delete commands

  • 562d3ad: chore: enable eslint's no-shadow rule

  • 9cef492: Adds the logic of @cloudflare/pages-functions-compiler directly into wrangler. This generates a Worker from a folder of functions.

    Also adds support for sourcemaps and automatically watching dependents to trigger a re-build.

  • 3426c13: fix: prevent useWorker's inifinite restarts during dev

  • e9a1820: Upgrade miniflare to 2.0.0-rc.5

  • 7156e39: Pass bindings correctly to miniflare/child_process.spawn in dev, to prevent miniflare from erroring out on startup

  • ce2d7d1: Add experimental support for worker-to-worker service bindings. This introduces a new field in configuration experimental_services, and serialises it when creating and uploading a worker definition. This is highly experimental, and doesn't work with wrangler dev yet.

  • 072566f: Fixed KV getNamespaceId preview flag bug

  • 5856807: Improve validation message for kv:namespace create

    Previously, if the user passed multiple positional arguments (which is invalid) the error message would suggest that these should be grouped in quotes. But this is also wrong, since a namespace binding name must not contain spaces.

  • 34ad323: Refactor the way we convert configurations for bindings all the way through to the API where we upload a worker definition. This commit preserves the configuration structure (mostly) until the point we serialise it for the API. This prevents the way we use duck typing to detect a binding type when uploading, makes the types a bit simpler, and makes it easier to add other types of bindings in the future (notably, the upcoming service bindings.)

0.0.6

Patch Changes

  • 421f2e4: Update base version to 0.0.5, copy the README to packages/wrangler

0.0.5

Patch Changes

  • cea27fe: don't log file contents when writing via kv:key put <key> --path <path>

  • b53cbc8: CI/CD

    • Release flow triggered on PR's closed
  • 43e7a82: When using wrangler pages dev, enable source maps and log unhandled rejections

  • c716abc: Error and exit if the --type option is used for the init command.

    The --type option is no longer needed, nor supported.

    The type of a project is implicitly javascript, even if it includes a wasm (e.g. built from rust).

    Projects that would have had the webpack type need to be configured separately to have a custom build.

  • 3752acf: Add support for websockets in dev, i.e. when developing workers. This replaces the proxy layer that we use to connect to the 'edge' during preview mode, using the faye-wesocket library.

  • c7bee70: Patches typing mismatches between us, undici and miniflare when proxying requests in pages dev, and also adds fallback 404 behavior which was missed

  • 8b6c2d1: Add more fields to the tsconfig.json generated by wrangler init

  • 78cd080: Custom builds for dev and publish

  • cd05d20: import text file types into workers

  • 1216fc9: Export regular functions from dialog.ts, pass tests (followup from https://github.com/cloudflare/workers-sdk/pull/124)

  • 6fc4c50: Display error message when unknown command is provided to the wrangler CLI.

  • 23543fe: Allow the developer to exit init if there is already a toml file

  • 1df6b0c: enable @typescript-eslint/no-floating-promises, pass lint+type check

  • 3c5725f: CI/CD Cleanup

    • Removed the build step from tests, which should speed up the "Tests" Workflow.
    • Added a branch specific trigger for "Release", now the Workflow for "Release" should only work on PRs closed to main
    • Removed the "Changeset PR" Workflow. Now the "Release" Workflow will handle everything needed for Changesets.
  • fb0eae7: support importing .wasm files / workers-rs support

  • e928f94: Improve support for package exports conditionals, including "worker" condition

  • 43e7a82: Upgrade miniflare to 2.0.0-rc.4

  • f473942: Replaces the static asset server with a more faithful simulation of what happens with a production Pages project.

    Also improves error handling and automatically opens the browser when running wrangler pages dev.

0.0.0

Minor Changes

  • 689cd55: CI/CD Improvements

    Changeset

    Adding configuration allows for use of CLI for changesets. A necessary supplement to the changesets bot, and GitHub Action.

    • Installed Changeset CLI tool
    • NPX changeset init
      • Added changesets directory
      • Config
      • README
    • Modified the config for main branch instead of master

    ESLint & Prettier Integration

    Running Prettier as a rule through ESLint to improve CI/CD usage

    • Added additional TypeScript support for ESLint
    • Prettier errors as ESLint rule
    • .vscode directory w/ settings.json config added that enforces the usage of ESLint by anyone working in the workspace

Patch Changes

  • b0fcc7d: CI/CD Tests & Type Checking GH Workflow additions:

    • Added Testing script
    • Added Linting script
    • tsc is using skipLibCheck as a current workaround
      • TODO added for future removal
    • Runs on every Pull Request instance
    • Removed npm ci in favor of npm install
      • Removed --prefer-offline in favor of local cache artifact
  • 2f760f5: remove --polyfill-node

  • fd53780: kv:key put: make only one of value or --path <path> necessary

  • dc41476: Added optional shortcuts

  • 7858ca2: Removed NPM registry and timeout from CI

  • 85b5020: Make wrangler dev work with durable objects