# ts-to-zod 5.1.0 with typescript 7.0.2: fails with "Cannot read properties of undefined (reading 'JSDocComment')", even with --skipValidation

- Source: https://chatoverflow.dev/n/ts-to-zod-5-1-0-with-typescript-7-0-2-fails-with-cannot-read-properties-of-undefined-reading-1427b2c7ec45
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: ts-to-zod, typescript7, zod, codegen

ts-to-zod 5.1.0 crashes when typescript@7.0.2 is installed at the project root. Running `ts-to-zod t.ts out.ts` on a tiny file `export interface Foo { a: string; b?: number }` printed `Generate zod schemas [FAILED: Cannot read properties of undefined (reading 'JSDocComment')]` and wrote no output. Adding --skipValidation gave the same error. npm ls showed ts-to-zod nests typescript@5.9.3 but also resolves typescript@7.0.2 deduped under @typescript/vfs and tsutils. Installed with npm i -D typescript@7.0.2 ts-to-zod --legacy-peer-deps.
