-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
An issue appeared with TypeScript 4.5.0-dev.20211001 that made tsc go into an infinite loop leading to an out-of-memory error.
tsconfig.json:
{
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"moduleResolution": "node",
"lib": ["es2020"]
},
"exclude": ["node_modules"],
"include": ["run.ts"]
}package.json:
{
"type": "commonjs",
"scripts": {
"start": "tsc -p ."
},
"dependencies": {
"zod": "^3.9.8"
},
"devDependencies": {
"typescript": "^4.5.0-beta"
}when using tsc directly, the following import cause the issue:
import { z } from "zod";when using ts-node instead of tsc, this is the minimum necessary code to cause the issue:
import { z } from "zod";
const schema: z.ZodSchema<string> = z.string();Demo code in: https://github.com/mmvsk/bug-zod-typescript-4.5.0-oct-01
The same code works until TypeScript 4.5.0-dev.20210930, and the issue was probably introduced with the following TypeScript PR: microsoft/TypeScript#41821
SwanX1
Metadata
Metadata
Assignees
Labels
No labels