wrangler
4.164.0 · 17 Nov 2026MIT OR Apache-2.049.3M / weekRepositoryHomepagenpmAtom feed
2.21.3 is the newest release of 2.x.
In short
2 breaking3 new14 fixed
- Breaking
Move experimental options under the experimental object for unstable_dev
- Breaking
Refactor unstable_dev to use an experimental object, instead of a second options object
Security
3 advisories affect 2.7.0; 3.114.17 fixes them
- CriticalArbitrary remote code execution within `wrangler dev` Workers sandboxGHSA-f8mp-x433-5wpf · 3 Jan 2024Fixed in 2.20.2
- HighWrangler affected by OS Command Injection in `wrangler pages deploy`GHSA-36p8-mvp6-cv38 · 21 Jan 2026Fixed in 3.114.17
- ModerateCloudflare Wrangler directory traversal vulnerabilityGHSA-8c93-4hch-xgxp · 3 Aug 2023Fixed in 2.20.1
Release note
Minor Changes
After this PR,
wrangler init --yeswill generate a test for your new Worker project, using Vitest with TypeScript.
When usingwrangler 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.
Remove the experimental binding warning from Dispatch Namespace since it is GA.
Patch Changes
Resolve unstable_dev flakiness in tests by awaiting the dev registry
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--localmode where we are just writing to a local SQLite file.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 theWRANGLER_API_ENVIRONMENTenvironment variable tostaging.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.Fix
ReferenceErrorwhen usingwrangler dev --experimental-localin Node 16Remove login requirement from
wrangler dev --experimental-localUpgrade
miniflareto2.11.0Pages 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.
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
Improve
wrangler init --from-dashhelp text and error handlingAlways log when delegating to local
wranglerinstall.When a global
wranglercommand is executed in a package directory withwranglerinstalled locally, the command is redirected to the localwranglerinstall.
We now always log a message when this happens, so you know what's going on.- Breaking
Move experimental options under the experimental object for unstable_dev
Update NO_D1_WARNING to make it clear how to turn it off
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 ind1 migrations applyhas been improved to handle a wider range of error types.Fixes #2463
Cleanly exit
wrangler dev --experimental-localwhen pressingx/q/CTRL-CMake --from-dash error output clearer
This PR makes it clearer what --from-dash wants from you.
Respect
FORCE_COLOR=0environment variable to disable colored output when usingwrangler dev --local- Breaking
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 } });
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.