Wrangler Changelog
 2023-10-26
 3.15.0
#4201
0cac2c46Thanks @penalosa! - Callout--minifywhen script size is too large#4209
24d1c5cfThanks @mrbbot! - fix: suppress compatibility date fallback warnings if nowranglerupdate is availableIf a compatibility date greater than the installed version of
workerdwas configured, a warning would be logged. This warning was only actionable if a new version ofwranglerwas available. The intent here was to warn if a user set a new compatibility date, but forgot to updatewranglermeaning 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 devsessions without a configured compatibility date to the installed version ofworkerd. This previously defaulted to the current date, which may have been unsupported by the installed runtime.#4135
53218261Thanks @Cherry! - feat: resolve npm exports for file importsPreviously, 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
exportsfield:import wasm from "svg2png-wasm/svg2png_wasm_bg.wasm";This will look at the package’s
exportsfield inpackage.jsonand resolve the file usingresolve.exports.#4232
69b43030Thanks @romeupalos! - fix: usezone_nameto determine a zone when the pattern is a custom hostnameIn 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 devwas used inwrangler deploy, which caused wrangler to fail with:✘ [ERROR] Could not find zone for [partner-saas-domain.com]
#4198
b404ab70Thanks @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#4215
950bc401Thanks @RamIdeas! - fix various logging of shell commands to correctly quote args when needed#4274
be0c6283Thanks @jspspike! - chore: bumpminiflareto3.20231025.0This change enables Node-like
console.log()ing in local mode. Objects with lots of properties, and instances of internal classes likeRequest,Headers,ReadableStream, etc will now be logged with much more detail.#4127
3d55f965Thanks @mrbbot! - fix: store temporary files in.wranglerAs 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 runningwrangler pages dev.This change also means you no longer need to set
cwdandresolveSourceMapLocationsin.vscode/launch.jsonwhen creating anattachconfiguration for breakpoint debugging. Your.vscode/launch.jsonshould 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
05798038Thanks @gabivlj! - Move helper cli files of C3 into @cloudflare/cli and make Wrangler and C3 depend on it#4235
46cd2df5Thanks @mrbbot! - fix: ensureconsole.log()s during startup are displayedPreviously,
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.
 2023-10-19
 3.14.0
#4204
38fdbe9bThanks @matthewdavidrodgers! - Support user limits for CPU timeUser limits provided via script metadata on upload
Example configuration:
[limits] cpu_ms = 20000#2162
a1f212e6Thanks @WalshyDev! - add support for service bindings inwrangler pages devby providing the new--service|-sflag which accepts an array ofBINDING_NAME=SCRIPT_NAMEwhereBINDING_NAMEis the name of the binding andSCRIPT_NAMEis the name of the worker (as defined in itswrangler.toml), such workers need to be running locally with withwrangler 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 respectivelywrangler devandwrangler pages ./publicDir --service MY_SERVICE=worker-athis will add theMY_SERVICEbinding to pages’ workerenvobject.Note: additionally after the
SCRIPT_NAMEthe 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.
 2023-10-17
 3.13.2
#4206
8e927170Thanks @1000hz! - chore: bumpminiflareto3.20231016.0#4144
54800f6fThanks @a-robinson! - Log a warning when using a Hyperdrive binding in local wrangler dev
 2023-10-12
 3.13.1
- #4171 
88f15f61Thanks @penalosa! - patch: This release fixes some regressions related to runningwrangler devthat 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
#4161
403bc25cThanks @RamIdeas! - Fix wrangler generated types to match runtime exports#3960
c36b78b4Thanks @RamIdeas! - Refactoring the internals of wrangler dev servers (includingwrangler dev,wrangler dev --remoteandunstable_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
 
#3590
f4ad634aThanks @penalosa! - fix: When a middleware is configured which doesn’t support your Worker’s script format, fail early with a helpful error message
 2023-10-11
 3.12.0
#4071
f880a009Thanks @matthewdavidrodgers! - Support TailEvent messages in Tail sessionsWhen 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
93833f04Thanks @a-robinson! - feature: Support Queue consumer events in tailSo that it’s less confusing when tailing a worker that consumes events from a Queue.
#2687
3077016fThanks @jrf0110! - Fixes large Pages projects failing to complete direct upload due to expiring JWTsFor 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
f4d28918Thanks @a-robinson! - Default new Hyperdrive configs for PostgreSQL databases to port 5432 if the port is not specified
 2023-10-05
 3.11.0
#3726
7d20bdbdThanks @petebacondarwin! - feat: support partial bundling with configurable external modulesSetting
find_additional_modulestotruein your configuration file will now instruct Wrangler to look for files in yourbase_dirthat match your configuredrules, and deploy them as unbundled, external modules with your Worker.base_dirdefaults to the directory containing yourmainentrypoint.Wrangler can operate in two modes: the default bundling mode and
--no-bundlemode. 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-bundlemode 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_modulesistrue, and the file matches one of the configuredrules. See https://developers.cloudflare.com/workers/wrangler/bundling/ for more details and examples.#4093
c71d8a0fThanks @mrbbot! - chore: bumpminiflareto3.20231002.0#3726
7d20bdbdThanks @petebacondarwin! - fix: ensure that additional modules appear in the out-dirWhen using
find_additional_modules(orno_bundle) we find files that will be uploaded to be deployed alongside the Worker.Previously, if an
outDirwas specified, only the Worker code was output to this directory. Now all additional modules are also output there too.#4067
31270711Thanks @mrbbot! - fix: generate valid source maps withwrangler pages devon macOSOn macOS,
wrangler pages devpreviously 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
9a7559b6Thanks @RamIdeas! - fix: respect the options.local value in unstable_dev (it was being ignored)#4107
807ab931Thanks @mrbbot! - chore: bumpminiflareto3.20231002.1#3726
7d20bdbdThanks @petebacondarwin! - fix: allow__STATIC_CONTENT_MANIFESTmodule to be imported anywhere__STATIC_CONTENT_MANIFESTcan now be imported in subdirectories when--no-bundleorfind_additional_modulesare enabled.#3926
f585f695Thanks @penalosa! - Log more detail about tokens after authentication errors#3695
1d0b7ad5Thanks @JacksonKearl! - Fixedpages devcrashing and leaving port open when building a worker script fails#4066
c8b4a07fThanks @RamIdeas! - fix: we no longer infer pathnames from route patterns as the hostDuring local development, inside your worker, the host of
request.urlis inferred from theroutesin 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.
 2023-09-28
 3.10.1
#4041
6b1c327dThanks @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
f8c52b93Thanks @mrbbot! - fix: allowwrangler pages devsessions to be reloadedPreviously,
wrangler pages devattempted to send messages on a closed IPC channel when sources changed, resulting in anERR_IPC_CHANNEL_CLOSEDerror. This change ensures the channel stays open until the user exitswrangler pages dev.
 2023-09-26
 3.10.0
#4013
3cd72862Thanks @elithrar! - Adds wrangler support for Vectorize, Cloudflare’s new vector database, withwrangler vectorize. Visit the developer documentation (https://developers.cloudflare.com/vectorize/) to learn more and create your first vector database withwrangler vectorize create my-first-index.#3999
ee6f3458Thanks @OilyLime! - Adds support for Hyperdrive, viawrangler hyperdrive.#4034
bde9d64aThanks @ndisidore! - Adds Vectorize support uploading batches of newline delimited json (ndjson) vectors from a source file. Load a dataset withvectorize insert my-index --file vectors.ndjson#4028
d5389731Thanks @JacobMGEvans! - fix: Bulk Secret Draft WorkerFixes the issue of a upload of a Secret when a Worker doesn’t exist yet, the draft worker is created and the secret is uploaded to it.
Fixes https://github.com/cloudflare/wrangler-action/issues/162
 2023-09-25
 3.9.1
#3992
35564741Thanks @edevil! - Add AI binding that will be used to interact with the AI project.Example
wrangler.tomlname = "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
bc8c147aThanks @rozenmd! - fix: remove warning around using D1’s binding, and clean up the epilogue when running D1 commands#4027
9e466599Thanks @jspspike! - Add WebGPU support through miniflare update#3986
00247a8dThanks @edevil! - Added AI related CLI commands
 2023-09-20
 3.9.0
Note this release changes the layout of persisted data in the .wrangler folder. KV namespaces, R2 buckets and D1 databases will automatically be migrated to the new layout. See the corresponding miniflare@3.20230918.0 release notes for more information.
#3951
e0850ad1Thanks @mrbbot! - feat: add support for breakpoint debugging towrangler dev’s--remoteand--no-bundlemodesPreviously, 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
--remoteand--no-bundletogether, uncaught errors will now be source-mapped when logged too.#3951
e0850ad1Thanks @mrbbot! - feat: add support for Visual Studio Code’s built-in breakpoint debuggerWrangler now supports breakpoint debugging with Visual Studio Code’s debugger. Create a
.vscode/launch.jsonfile 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.#3954
bc88f0ecThanks @dario-piotrowicz! - updatewrangler pages devD1 and DO descriptions#3928
95b24b1eThanks @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
 2023-09-13
 3.8.0
#3775
3af30879Thanks @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
-Jflag that allows the user to specify a jurisdiction. When passing the-Jflag, you will only be able to interact with R2 resources within that jurisdiction.# List all of the buckets in the EU jurisdictionwrangler r2 bucket list -J eu# Downloads the object 'myfile.txt' from the bucket 'mybucket' in EU jurisdictionwrangler r2 object get mybucket/myfile.txt -J euTo 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>" }]#3901
a986f19fThanks @DaniFoldi! - Only require preview_id and preview_bucket_name in remote dev mode#3912
0ba58841Thanks @jspspike! - Ignore cached account id whenCLOUDFLARE_ACCOUNT_IDis specified
 2023-09-05
 3.7.0
#3772
a3b3765dThanks @jspspike! - Bump esbuild version to 0.17.19. Breaking changes to esbuild are documented here#3895
40f56562Thanks @mrbbot! - chore: bumpminiflareto3.20230904.0#3774
ae2d5cb5Thanks @mrbbot! - feat: support breakpoint debugging in local modewrangler devnow supports breakpoint debugging in local mode! Pressdto open DevTools and set breakpoints.
 2023-08-28
 2.20.1
- #3820 
546c2319Thanks @GregBrimble! - fix: Preventwrangler pages devfrom serving asset files outside of the build output directory 
 2023-08-24
 3.6.0
#3727
a5e7c0beThanks @echen67! - Warn user when the last deployment was via the API#3762
18dc7b54Thanks @GregBrimble! - feat: Add internalwrangler pages project validate [directory]command which validates an asset directory#3758
0adccc71Thanks @jahands! - fix: Retry deployment errors in wrangler pages publishThis will improve reliability when deploying to Cloudflare Pages