wrangler
4.164.0 · 17 Nov 2026MIT OR Apache-2.049.3M / weekRepositoryHomepagenpmAtom feed
4.167.0 is the newest release of 4.x.
In short
3 new7 fixed2 internal
Release note
Minor Changes
Introduce
createTestHarness()for integration testing WorkersIt 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 withdebug()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();Surface pipeline status and failure reasons in
wrangler pipelines listandwrangler pipelines getwrangler pipelines listnow includes aStatuscolumn, and when any pipelines are in afailedstate it prints a summary of each failing pipeline along with the reason reported by the API.wrangler pipelines getnow shows the pipelineStatusin 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.Add
--version-tagsupport towrangler versions deployto deploy a version by its tagYou can now roll out or roll back a version by the tag it was uploaded with (e.g. a commit SHA passed to
--tagat 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-tagvalues. 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
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
--strictflag was passed in. Now this warning is always printed, and it remains non-blocking in non-interactive contexts.Handle API validation errors from
wrangler containers sshWrangler now lets the Containers API validate SSH instance IDs and preserves raw API error bodies such as
INVALID_INSTANCE_IDwhen reporting validation failures.Show actionable error message when authentication fails during remote dev
When
wrangler devwith 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.
Fix
wrangler types --checkreporting types as out of date in multi-worker setupsPreviously, running
wrangler types --check -c primary/wrangler.jsoncin 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-cflags during generation) were not stored in the generated types file header, so--checkhad 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
--checkcan recover them automatically. Users no longer need to re-pass every-cflag when running--check— only the primary config is required.Prevent delete-only
wrangler secret bulkinput from creating a new WorkerPreviously,
wrangler secret bulkcould 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.Preserve all deployment-affecting CLI flags in the interactive deploy config flow
When running
wrangler deploywithout 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 generatedwrangler.jsoncconfig file (where a config field equivalent exists) and included in the suggested CLI command when the user declines config file generation.Validate JSON stdin values for
wrangler secret bulkJSON 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.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.