zudo-cloudflare-wisdom

Type to search...

to open search from anywhere

Compatibility Dates

CreatedApr 4, 2026Takeshi Takatsudo

Understanding and managing Cloudflare compatibility dates

What Are Compatibility Dates?

The compatibility_date in wrangler.toml pins your Worker to a specific version of the Cloudflare Workers runtime. This prevents breaking changes from affecting your deployed code.

compatibility_date = "2024-12-01"

How They Work

  • Cloudflare introduces runtime changes behind flags tied to dates
  • Setting a date enables all changes up to and including that date
  • Your code uses the same runtime behavior until you update the date
  • New projects should use a recent date

When to Update

Update the compatibility date when:

  • You are actively working on the project
  • You want access to new runtime features
  • The Cloudflare docs recommend a minimum date for a feature you need

⚠️ Warning

Updating the compatibility date can change runtime behavior. Test thoroughly after updating, especially if jumping across many months.

Compatibility Flags

For granular control, you can enable or disable specific flags:

compatibility_date = "2024-12-01"
compatibility_flags = ["nodejs_compat"]

Common flags:

FlagDescription
nodejs_compatEnable Node.js built-in module support
streams_enable_constructorsEnable constructable Streams API