^3.25.56 || ^4.0.0.
Passing your own supported Zod 3 schema to
schemaTask or toolTask remains supported. This does not make Zod 3 and Zod 4 schemas interchangeable when you compose or inspect them yourself.
Typechecking, tests, or deployment fail after upgrading
An older Zod installation can be missing the entry points, types, or schema behavior that Trigger.dev v4.6 requires. Expect TypeScript errors when an unsupported version is resolved, particularly withskipLibCheck: false. Tests may also fail when they import or execute schemas. Deployment loads your task code, so an incompatible runtime installation causes deployment errors even if your local tooling skips typechecking. A passing local test suite does not establish that an unsupported version is safe to deploy.
Symptoms include missing zod/v4 or zod/v4/core exports, missing Zod types, incompatible generic parameters, and errors while loading tasks. The exact failure depends on the version and dependency tree; not every unsupported version fails at the same stage.
Check the installed version
Inspect the resolved dependencies in the package that contains your tasks, not only the version range inpackage.json:
Update Zod
Choose whether to move your application to Zod 4 or keep its existing Zod 3 schemas:- Move to Zod 4
- Stay on Zod 3
Install the latest Zod 4 release:Review Zod’s migration guide for changes to your own schemas and error handling.
Verify the update
- Commit the updated manifest and lockfile, and make sure CI uses them.
- Recheck the installed Zod versions in your local and deployment environments.
- Run your project’s TypeScript checks and tests, including code that constructs or inspects schemas.
- Keep the CLI and SDK versions aligned using the package upgrade guide, then retry deployment.
skipLibCheck or ignored peer-dependency warnings as a compatibility fix. They do not change the runtime package that deployment loads. You do not need to add Zod as a direct dependency if your application does not import it.
Parsing still fails with a supported Zod 3 version
Supporting a Zod 3 schema as an SDK input is different from nesting a Trigger.dev-exported Zod 4 schema inside a Zod 3 object. Cross-major composition can fail during typechecking or parsing. For example, this mixes a Zod 3 object with a Zod 4RetryOptions schema:
incompatible-schemas.ts
zod/v4 entry point is available in both supported Zod 3 packages and Zod 4 packages:
compatible-schemas.ts
An instanceof check stops matching
A Zod 4 error is not an instance of the Zod 3 ZodError constructor. A constructor check against your project’s Zod 3 import can stop matching errors produced by Trigger.dev’s schemas:
mismatched-error-check.ts
schema-error-handling.ts
schema instanceof z.ZodObject. Multiple installed copies can also have different constructors, even within the same major version. Prefer parsing and the returned validation result over inspecting classes or private fields such as _def.
These examples are not an exhaustive list of cross-major differences. If errors remain after updating, check which Zod implementation creates each schema and which code composes, parses, or inspects it.
