Wrangler "compatibility_date" Missing or Invalid - Fix Workers Deploy
Cloudflare Workers pins runtime behavior to a compatibility_date. Wrangler errored because the date is missing from wrangler.toml, set in the future, or a needed compatibility_flags entry is absent.
What this error means
wrangler deploy/dev fails or warns about compatibility_date - missing, in the future, or required for a feature you use. It is deterministic: the same config fails the same way until the date/flags are corrected.
✘ [ERROR] A compatibility_date is required when publishing. Add the following to
your wrangler.toml:
```
compatibility_date = "2026-06-25"
```Common causes
Missing or future compatibility_date
Without compatibility_date, Wrangler refuses to publish. A date in the future is also rejected because the runtime cannot honor behavior that has not shipped.
Required compatibility flag not set
Some runtime features (e.g. nodejs_compat) need an explicit flag in addition to the date; without it, APIs your code relies on are unavailable.
How to fix it
Set a valid compatibility_date and flags
Pin a real (non-future) date and add any flags your Worker needs.
# wrangler.toml
name = "my-worker"
main = "src/index.ts"
compatibility_date = "2026-06-25"
compatibility_flags = ["nodejs_compat"]Verify the config locally
- Run
npx wrangler devto confirm the runtime accepts the date and flags. - Bump
compatibility_datedeliberately when adopting new runtime behavior, and test after. - Keep the date no later than today - a future date is rejected.
How to prevent it
- Always set
compatibility_dateinwrangler.tomland keep it current but not in the future. - Add required
compatibility_flags(e.g.nodejs_compat) for the APIs you use. - Test runtime behavior with
wrangler devafter changing the date or flags.