You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
V8 15.6: new Function("") now allowed during requests, which breaks code-generation probes (zod v4) in deployed Workers #7740
Since the V8 15.6.75 update (3f8a3dd), new Function('') is allowed inside a request. Real code generation, like new Function('return 1'), is still blocked. Libraries probe whether code generation works by trying new Function(''). That probe now passes, so they switch to code-generating paths, and those throw EvalError: Code generation from strings disallowed for this context on the first real use.
This broke Workers that were deployed weeks or months ago, with no redeploy. It started around 2026-10-13 20:00 UTC, which we assume is when 15.6 rolled out to production.
Most visible case: zod v4
zod v4 (and the zod/v4 build in zod 3.25.x) decides once whether to JIT-compile object parsers:
Before 15.6, the probe threw, so zod used its interpreter and everything worked. On 15.6 the probe passes, zod compiles parsers with new Function(code), and every parse fails with EvalError.
Later zod versions (3.25.76 and 4.x) skip the probe when navigator.userAgent includes Cloudflare. navigator only exists from compat date 2022-03-21, though, so Workers with an older compat date or none (2021-11-01) are still affected on current zod. Workers bundling zod 3.25.27 to 3.25.75 are affected on any compat date.
Repro
exportdefault{fetch(){letprobe;try{newFunction("");probe="allowed";}catch{probe="blocked";}letreal;try{newFunction("return 1")();real="allowed";}catch(e){real=String(e);}returnnewResponse(JSON.stringify({ probe, real }));},};
A minimal zod case: a schema built at module scope with zod 3.25.27, import { z } from "zod/v4", then schema.parse({...}) inside fetch.
Impact
Deployed Workers that use zod v4 started returning errors with no change on the customer's side. For us, that was MCP servers returning 400 "Invalid JSON-RPC message", plus some auth policies.
The 15.6 commit message says the update "needs no compatibility flag". This behavior change is observable, though, and it breaks already-deployed code.
Ask
One of:
Keep new Function('') blocked wherever real code generation is blocked, so feature probes keep giving the right answer; or
Put the new allowance behind a compatibility date/flag, so existing Workers keep the 15.5 behavior.
We've worked around it on our side by forcing zod's jitless mode on workerd. That only reaches Workers once they're rebuilt.
Activity