Wrangler Changelog
 2023-11-22
 3.17.1
- #4474 - 382ef8f5Thanks @mrbbot! - fix: open browser to correct url pressing- bin- --remotemode- 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 - 3bd57238Thanks @RamIdeas! - Changes the default directory for log files to workaround frameworks that are watching the entire- .wranglerdirectory in the project root for changes- Also includes a fix for commands with - --jsonwhere the log file location message would cause stdout to not be valid JSON. That message now goes to stderr.
 2023-11-21
 3.17.0
- #4341 - d9908743Thanks @RamIdeas! - Wrangler now writes all logs to a .log file in the- .wranglerdirectory. 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.
- #4469 - d5e1966bThanks @mrbbot! - fix: report correct line and column numbers when source mapping errors with- wrangler dev --remote
- #4455 - 1747d215Thanks @rozenmd! - fix: make it possible to ignore hyperdrive warnings
- #4456 - 805d5241Thanks @dario-piotrowicz! - add warnings about ai and verctorize bindings not being supported locally
- #4478 - 7b54350bThanks @penalosa! - Don’t log sensitive data to the Wrangler debug log file by default. This includes API request headers and responses.
 2023-11-17
 3.16.0
- #4347 102e15f9Thanks @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 - dd270d00Thanks @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. 
- #4402 - baa76e77Thanks @rozenmd! - This PR adds a fetch handler that uses- page, assuming- result_infoprovided by the endpoint contains- page,- per_page, and- total- This is needed as the existing - fetchListResulthandler for fetching potentially paginated results doesn’t work for endpoints that don’t implement- cursor.- Fixes #4349 
- #4337 - 6c8f41f8Thanks @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 7fbe1937Thanks @jspspike! - Change local dev server default ip to*instead of0.0.0.0. This will cause the dev server to listen on both ipv4 and ipv6 interfaces
- #4222 f867e01cThanks @tmthecoder! - Support for hyperdrive bindings in local wrangler dev
- #4219 0453b447Thanks @maxwellpeterson! - Allows uploads with both cron triggers and smart placement enabled
- #4437 - 05b1bbd2Thanks @jspspike! - Change dev registry and inspector server to listen on 127.0.0.1 instead of all interfaces
- Updated dependencies [ - 4f8b3420,- 16cc2e92,- 3637d97a,- 29a59d4e,- 7fbe1937,- 76787861,- 8a25b7fb]:
 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 no- wranglerupdate is available- If 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 of- wranglerwas available. The intent here was to warn if a user set a new compatibility date, but forgot to update- wranglermeaning 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 of- workerd. 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 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 - exportsfield:import wasm from "svg2png-wasm/svg2png_wasm_bg.wasm";- This will look at the package’s - exportsfield in- package.jsonand resolve the file using- resolve.exports.
- #4232 - 69b43030Thanks @romeupalos! - fix: use- zone_nameto 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 devwas used in- wrangler 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: bump- miniflareto- 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 - 3d55f965Thanks @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 - cwdand- resolveSourceMapLocationsin- .vscode/launch.jsonwhen creating an- attachconfiguration 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: 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.
 2023-10-19
 3.14.0
- #4204 - 38fdbe9bThanks @matthewdavidrodgers! - Support user limits for CPU time- User limits provided via script metadata on upload - Example configuration: - [limits] cpu_ms = 20000
- #2162 - a1f212e6Thanks @WalshyDev! - add support for service bindings in- wrangler pages devby providing the new- --service|- -sflag which accepts an array of- BINDING_NAME=SCRIPT_NAMEwhere- BINDING_NAMEis the name of the binding and- SCRIPT_NAMEis 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 devand- wrangler pages ./publicDir --service MY_SERVICE=worker-athis will add the- MY_SERVICEbinding to pages’ worker- envobject.- 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: bump- miniflareto- 3.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 (including- wrangler dev,- wrangler dev --remoteand- 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
 
- #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 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 - 93833f04Thanks @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. 
- #2687 - 3077016fThanks @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 - 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 modules- Setting - find_additional_modulesto- truein your configuration file will now instruct Wrangler to look for files in your- base_dirthat match your configured- rules, and deploy them as unbundled, external modules with your Worker.- base_dirdefaults to the directory containing your- mainentrypoint.- 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_modulesis- true, and the file matches one of the configured- rules. See https://developers.cloudflare.com/workers/wrangler/bundling/ for more details and examples.
- #4093 - c71d8a0fThanks @mrbbot! - chore: bump- miniflareto- 3.20231002.0
- #3726 - 7d20bdbdThanks @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 - 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 with- wrangler pages devon macOS- On 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: bump- miniflareto- 3.20231002.1
- #3726 - 7d20bdbdThanks @petebacondarwin! - fix: allow- __STATIC_CONTENT_MANIFESTmodule to be imported anywhere- __STATIC_CONTENT_MANIFESTcan now be imported in subdirectories when- --no-bundleor- find_additional_modulesare enabled.
- #3926 - f585f695Thanks @penalosa! - Log more detail about tokens after authentication errors
- #3695 - 1d0b7ad5Thanks @JacksonKearl! - Fixed- pages 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 host- During local development, inside your worker, the host of - request.urlis inferred from the- routesin 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: allow- wrangler pages devsessions to be reloaded- Previously, - wrangler pages devattempted to send messages on a closed IPC channel when sources changed, resulting in an- ERR_IPC_CHANNEL_CLOSEDerror. This change ensures the channel stays open until the user exits- wrangler pages dev.
 2023-09-26
 3.10.0
- #4013 - 3cd72862Thanks @elithrar! - Adds wrangler support for Vectorize, Cloudflare’s new vector database, with- wrangler vectorize. Visit the developer documentation (https://developers.cloudflare.com/vectorize/) to learn more and create your first vector database with- wrangler vectorize create my-first-index.
- #3999 - ee6f3458Thanks @OilyLime! - Adds support for Hyperdrive, via- wrangler hyperdrive.
- #4034 - bde9d64aThanks @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
- #4028 - d5389731Thanks @JacobMGEvans! - fix: Bulk Secret Draft Worker- Fixes 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.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 - 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 to- wrangler dev’s- --remoteand- --no-bundlemodes- 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 - --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 debugger- Wrangler 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! - update- wrangler 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