Vc dev fails with Zod v4 type definitions (works with Zod v3)

Current versus Expected behavior

When running a minimal Hono backend with Zod v4 using vc dev, the CLI fails with multiple TypeScript syntax errors inside Zod’s .d.ts files.

The same code works fine with Zod v3, and also works when run directly with node or ts-node.

Expected:

The dev server should start normally without TypeScript parsing errors.

Actual:

The CLI shows errors when a request occurs, throwing errors like:

node_modules/zod/v4/classic/schemas.d.ts:442:60 - error TS1005: ',' expected.

Code, configuration, and steps that reproduce this issue

  1. Create new project:
mkdir issue && cd issue
npm init -y
npm install hono@4.9.0 zod@4.0.17
  1. src/index.ts:
import { Hono } from "hono";
import * as z from "zod"; // triggers the errors

const app = new Hono();

app.get("/", (c) => c.text("cesconix"));

export default app;
  1. Run:
vc dev

Note:

  • With Zod v3, no issue occurs.
  • With node or ts-node, no issue occurs — only vc dev fails.
  • Downgrading Zod to v3 is a temporary workaround.

Project information (URL, framework, environment, project settings)

  • Node.js: 22.x
  • Vercel CLI: 44.7.3
  • Framework: Hono 4.9.0
  • Zod: 4.0.17

The issue is that @vercel/node is using an outdated Typescript version (4.9.5) which is incompatible with Zod 4’s syntax.

You have to override the dependency to use a more recent version, but it’s not a very straightforward process. Try to follow the steps listed here: node.js - Typescript Errors from `node_modules` in Vercel CLI's logs - Stack Overflow

1 Like

This issue is gnarly, i could not find a solution for this yet, even the stackoverflow post did not work with me for some reason

also battling this issue. I got the node_modules to line up the ts versions, but running vercel dev and still hit these type issues at runtime. Problematic for packages like upstash/workflow that rely on zod v4.

package.json:

{
    "type": "module",
    "scripts": {
        "start": "vercel dev --listen 3000",
        "test": "jest",
        "test:watch": "jest --watch",
        "test:coverage": "jest --coverage"
    },
    "dependencies": {
        "@ai-sdk/anthropic": "^2.0.23",
        "@supabase/supabase-js": "^2.57.4",
        "@upstash/workflow": "^0.2.20",
        "ai": "^4.3.19",
        "duck-duck-scrape": "^2.2.7",
        "zod": "^3.24.1"
    },
    "devDependencies": {
        "@types/jest": "^30.0.0",
        "@types/node": "^24.5.2",
        "@vercel/node": "^5.3.24",
        "jest": "^30.1.3",
        "ts-jest": "^29.4.2",
        "typescript": "^5.9.2"
    },
    "overrides": {
        "@vercel/node": {
            "typescript": "^5.9.3"
        },
        "ts-node": {
            "typescript": "^5.9.3"
        }
    }
}

tsconfig.json:

{
  "compilerOptions": {
    "target": "es2022",
    "module": "nodenext",
    "moduleResolution": "nodenext",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "declaration": false,
    "types": ["node"]
  },
  "include": ["**/*.ts"],
  "exclude": ["node_modules", "dist"]
}

:waving_hand: Thanks for the report. vercel@48.4.1 has just been published with a fix. This will respect the Typescript version you have installed so you don’t need to do the overrides in the package.json. In a future release, we won’t be running typechecks during dev at all!

only vc dev fails.

@cesconix And just to clarify that I have the right context, your requests still work, it’s just that we emit these errors in the terminal, correct?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.