What this thread does
Do first: compare the intended environment's compatibility_date, compatibility_flags and binding declarations, then run wrangler types --env production for that same environment.
Short answer
As of November 2026, use current Workers/Wrangler docs. A compatibility date selects behavior changes; it does not freeze the entire runtime binary. Keep the same deliberate date and flags across environments, while declaring distinct resource bindings explicitly. Named environments do not inherit root vars or bindings. Compatibility dates, environment configuration.
Choose / don't choose
- Existing Worker: choose its established compatibility date until changes are reviewed; don't advance the date just to fix an absent binding. Date policy.
- New Worker: choose today's date,
2026-11-24for this recipe, then promote that value deliberately; don't assume all Node flags must be copied from an older example. Date policy. - Local plus remote binding: choose when only a resource needs Cloudflare's network; don't infer a full remote runtime from
remote: true. Usewrangler dev --remote --env developmentwhen the execution environment itself must be compared. It is legacy, unsupported by the Vite plugin. Development modes.
Not for: choosing a spiky API platform; see cloudflare-workers-or-aws-lambda-for-a-spiky-api.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
compatibility_date | Preserve intended date in all environments; new project example 2026-11-24 follows current-date guidance | Current Workers; deliberate application choice | Dates |
compatibility_flags | For dates 2024-09-23 through 2026-08-03, nodejs_compat opts into Node support; from 2026-08-04, Node compatibility is enabled by default, so omit redundant positive flags in new configs | Current documented date boundaries | Node support |
compatibility_flags opt-out | At dates from 2026-08-04, remove positive Node.js compatibility flags to disable support, then add both no_nodejs_compat and no_nodejs_compat_v2 | Current documented date boundaries | Flags |
env.production.vars | Explicit map of production nonsecret values; root vars is not inherited | Current Wrangler | Variables |
| Per-environment bindings | Explicit binding names and intended target IDs/names per environment, even if root declares them | Current Wrangler | Non-inheritable keys |
wrangler types --env | production for only that environment; use the same selection as deployment | Current Wrangler | Types CLI |
Binding remote | true for a supported remote resource during local execution; bindings connect to locally simulated resources by default, except AI bindings, which always run remotely | Current local development | Remote bindings |
Node support remains partial: importing a polyfilled module does not establish that every method exists. Node API table.
Order of operations
1. Inventory required runtime APIs and binding names. Keep inheritable date/flags aligned; declare bindings and environment variables separately for each environment using configuration rules. Store sensitive values as environment-specific secrets, not vars. Environment guide. 2. After binding or date/flag changes, run wrangler types --env production, include the generated declaration in TypeScript configuration and typecheck the intended bundle. Types. 3. Keep dev and deployment on the same named environment and pinned dependency lock. Use isolated remote resources when the local simulation is insufficient; remote bindings connect to real, production resources. Development modes. 4. Inspect each environment's resource identity and binding availability through a harmless app operation. For named-environment service binding, target <worker-name>-<environment-name>. Service targets.
Cloudflare's January 13, 2026 changelog changed default wrangler types behavior to aggregate all environments. --env still selects one. Cherry's May 15, 2025 request records the older limitation; do not apply that old behavior to current docs.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
| Binding absent only in named environment | Root binding/vars not inherited | Repeat binding declaration under selected environment with correct resource; regenerate that environment's types | Environment guide |
| Service binding targets wrong environment | Deprecated service environment property confused with Wrangler environments | Set service to deployed suffixed Worker name; maintain one actual target per named environment | vladshcherbin, July 31, 2025; emily-shen explanation |
| Polyfill shim API methods throw errors | Mocked methods can noop or throw; imports remain possible when methods are unsupported | Check Node API support and use supported API/dependency or another runtime | Node compatibility |
Missing
- The dependency/API inventory and existing runtime date are unspecified, so the exact additional flags required by this Worker cannot be enumerated. The new-project date is a selection example, not a reason to advance an existing deployment blindly.
Checked
2026-11-12; current docs, November 2026. Sources read: date/flag/Node, configuration/environment, types and development references, dated changelog and Cherry/vladshcherbin issue reports. No Wrangler or deployment commands executed.
Started from a post by @Cloudflare, packaged by the editor. Original post