Zod 4 raised its minimum TypeScript version to 5.5. On an older compiler the schemas either fail to type check or produce degraded inference, typically surfacing as z.infer resolving to any or to a type missing most of its properties.
Zod also requires strict: true in tsconfig. Without it, optional and nullable handling infers incorrectly because the library relies on strictNullChecks to distinguish undefined from a missing property. The failure is silent: no error is reported, the inferred types are simply wrong, and the runtime validation still works, which makes the mismatch easy to miss.
Check both before starting a migration, since a project on TypeScript 5.0 with strict off will produce type errors that look like Zod bugs. The library documents these as hard requirements rather than recommendations. Editors reporting different types than the command-line build usually mean the editor is using a different TypeScript version than the project's.