-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
[TSC fails] RangeError: Maximum call stack size exceeded [with repro repo] #31230
Labels
Milestone
Comments
weswigham
added
Bug
A bug in TypeScript
Crash
For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
labels
May 8, 2019
orta
pushed a commit
to orta/TypeScript
that referenced
this issue
Jun 17, 2019
orta
pushed a commit
to orta/TypeScript
that referenced
this issue
Jul 31, 2019
@orta, please help to fix this issue. It blocks me from upgrading Gatsby and other small projects. Thanks. |
I have the same issue on TypeScript v3.6.4 |
Same issue on TS 3.7.2. |
As a workaround I relaxed the checks in my lib: export type ObjMapReadOnly<T> = Readonly<{ [key: string]: Readonly<T> }>;
- export type Thunk<T> = (() => T) | T;
+ export type Thunk<T> = (() => any) | T;
export type ComposeOutputTypeDefinition = Readonly<ObjectTypeComposer<any, any> | EnumTypeComposer>;
export class EnumTypeComposer {
public setFields(fields: { [name: string]: { [key: string]: any } }): this;
}
export class ObjectTypeComposer<TSource, TContext> {
public setFields(fields: ObjMapReadOnly<Resolver>): this;
public addResolver<TResolverSource>(opts: { type?: Thunk<ComposeOutputTypeDefinition> }): this;
}
export class Resolver {
public wrapArgs<NewContext>(
cb: () => {
[argName: string]: Thunk<Readonly<EnumTypeComposer>>;
}
): void;
public wrapType(cb: () => ComposeOutputTypeDefinition): void;
} It's better than |
nodkz
added a commit
to graphql-compose/graphql-compose
that referenced
this issue
Nov 25, 2019
…all stack size exceeded" Related: microsoft/TypeScript#31230 Closes #191
nodkz
added a commit
to graphql-compose/graphql-compose
that referenced
this issue
Dec 11, 2019
…tack size exceeded" Related: microsoft/TypeScript#31230 Related: #191
Possible alternative repro #35804 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TypeScript Version: Version 3.5.0-dev.20190503
Search Terms:
tsc, RangeError, Maximum call stack size exceeded
Code
Dramatically simplified
graphql-compose.d.ts
:Expected behavior:
Do not fall with
Maximum call stack size exceeded
error.Actual behavior:
> ts-max-call-stack@1.0.0 tsc /Users/nodkz/www/_sandbox/nodkz-tsc-problem > tsc /Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:72973 throw e; ^ RangeError: Maximum call stack size exceeded at __generator (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:30:13) at getUnmatchedProperties (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:37203:20) at getUnmatchedProperty (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:37237:20) at typesDefinitelyUnrelated (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:37245:19) at inferFromObjectTypes (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:37544:22) at inferFromTypes (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:37456:29) at inferFromContravariantTypes (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:37475:21) at applyToParameterTypes (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:37047:17) at inferFromSignature (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:37603:21) at inferFromSignatures (/Users/nodkz/www/_sandbox/nodkz-tsc-problem/node_modules/typescript/lib/tsc.js:37595:21)
Playground Link:
Simplified repro repo: https://github.com/nodkz/tsc-problem
The text was updated successfully, but these errors were encountered: