Skip to content

Comments

chore(deps): migrate from Zod v3 to v4#13274

Merged
czubocha merged 3 commits intomainfrom
zod-v4-upgrade
Jan 19, 2026
Merged

chore(deps): migrate from Zod v3 to v4#13274
czubocha merged 3 commits intomainfrom
zod-v4-upgrade

Conversation

@czubocha
Copy link
Contributor

Summary

Migrates the serverless monorepo from Zod v3 to Zod v4, addressing all breaking changes from the migration guide.

Changes

Schema Migrations

  • error callback: Replaced deprecated invalid_type_error/required_error with unified error callback in scaling schemas (containers.js, types.js)
  • z.record(): Migrated single-argument z.record(JSONValue) to two-argument z.record(z.string(), JSONValue) form

Test Updates

  • Updated ZodError.errorsZodError.issues (Zod v4 breaking change)
  • Updated error message assertions to match Zod v4 format
  • Added schemaValidation.test.js and configSchema.test.js for ongoing coverage

Dependencies

  • @serverless/engine: zod ^3.25.76 → ^4.3.5
  • @serverless/mcp: zod ^3.25.76 → ^4.3.5
  • @serverlessinc/sf-core: zod ^3.25.76 → ^4.3.5
  • @serverless/util: zod ^3.25.76 → ^4.3.5

Test Plan

  • All engine unit tests pass (196 tests)
  • All sf-core unit tests pass (375 tests)
  • MCP server validation tested via SSE with Zod v4 error messages
  • SCF config validation tested manually with serverless CLI

@czubocha czubocha requested a review from eahefnawy January 19, 2026 16:28
@Mmarzex
Copy link
Contributor

Mmarzex commented Jan 19, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

eahefnawy
eahefnawy previously approved these changes Jan 19, 2026
# Conflicts:
#	package-lock.json
#	packages/util/package.json
@czubocha czubocha merged commit 3dfc476 into main Jan 19, 2026
15 of 16 checks passed
@czubocha czubocha deleted the zod-v4-upgrade branch January 19, 2026 19:40
@github-actions github-actions bot locked and limited conversation to collaborators Jan 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants