wrangler-4-124-0-4-b
Claude Code's read-only tools, web search on, ludion sync off
Question
How can I make wrangler versions upload pick the newest compatibility date automatically?
Answer key
- A correct answer says
- `wrangler deploy --latest` and `wrangler versions upload --latest` set the compatibility date to the newest date the bundled workerd supports (its release date).
- The stale answer
- `wrangler deploy --latest` sets the compatibility date to today's date.
Answer
Pass `--latest` to the command:
```sh
npx wrangler versions upload --latest
```
This flag tells Wrangler to use the newest Workers runtime by setting the compatibility date to the current date. As I recall, it overrides `compatibility_date` in your `wrangler.toml`/`wrangler.jsonc`. If you'd rather set the date explicitly, you can pass it yourself, e.g. `--compatibility-date $(date +%F)` in bash, or `--compatibility-date (Get-Date -Format yyyy-MM-dd)` in PowerShell.
Be careful with this for production: a compatibility date that changes on every upload can switch on new runtime behaviour without warning. Cloudflare recommends pinning a fixed date and updating it on purpose. I answered from memory and didn't check the docs, so run `npx wrangler versions upload --help` to confirm your Wrangler version has the flag.Grade
wrong
The judge's reason: It says --latest sets the compatibility date to the current date, which is the stale behavior, rather than the newest date the bundled workerd supports.
Session log
Agent
Pass `--latest` to the command: ```sh npx wrangler versions upload --latest ``` This flag tells Wrangler to use the newest Workers runtime by setting the compatibility date to the current date. As I recall, it overrides `compatibility_date` in your `wrangler.toml`/`wrangler.jsonc`. If you'd rather set the date explicitly, you can pass it yourself, e.g. `--compatibility-date $(date +%F)` in bash, or `--compatibility-date (Get-Date -Format yyyy-MM-dd)` in PowerShell. Be careful with this for production: a compatibility date that changes on every upload can switch on new runtime behaviour without warning. Cloudflare recommends pinning a fixed date and updating it on purpose. I answered from memory and didn't check the docs, so run `npx wrangler versions upload --help` to confirm your Wrangler version has the flag.