-
Notifications
You must be signed in to change notification settings - Fork 12.8k
JavaScript heap out of memory when compiling typesafe-joi on v3.4.x #30794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am debugging TypeScript using the tag v3.4.1. I pause the execution of tsc randomly in vscode and analyze the call stack. Here are what I know about what TypeScript is doing:
Seems that ts is doing type check very slowly so every time I pause the stack tells me the same thing. |
Increasing heap memory limit does not help. tsc will eat up all memory. There seems a infinity loop consuming lots of memory. node --max-old-space-size=8192 node_modules/typescript/bin/tsc -p typesafe-joi-issue |
The same issue with me, the new version of |
Also experiencing this issue - |
Same here when compiling application with large type hierarchies. |
After upgrading to TS 3.4.3 we started to have out of memory issues with karma 3.0.0, karma-webpack 3.0.5 and awesome-typescript-loader 5.2.1 Downgrading to TS 3.3.3 solved the issue for us Here is the issue we had:
|
Getting a minimal repro |
@RyanCavanaugh it seems this oneliner does it: #30831 |
Here's the smallest (!) repro I have interface AbstractSchema<S, V> {
m1<T> (v: T): SchemaType<S, Exclude<V, T>>;
m2<T> (v: T): SchemaType<S, T>;
}
type SchemaType<S, V> = S extends object ? AnySchema<V> : never;
interface AnySchema<V> extends AnySchemaType<AnySchema<undefined>, V> { }
interface AnySchemaType<S extends AbstractSchema<any, any>, V> extends AbstractSchema<S, V> { } |
The issue is runaway recursion in |
TypeScript Version:
3.4.1, 3.4.2, 3.5.0-dev.20190406
Reproduction:
https://github.com/hjkcai/typesafe-joi/tree/feature/split-files
git clone https://github.com/hjkcai/typesafe-joi.git -b feature/split-files --depth=1 yarn yarn test
Update: the published version also has this problem. Reproduce using the published version:
Expected behavior:
tsc should work. It works in ts 3.3.
Actual behavior:
tsc -p .
TypeScript Server: canceled request with sequence number xxx
)Related Issues:
I saw lots of regression issues about recursion and type inference. typesafe-joi uses lots of recursions. Maybe they are somehow related?
typesafe-joi was crashed once (#28873). @j-oliveras @ahejlsberg Please help!
The text was updated successfully, but these errors were encountered: