Skip to content
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

[Only TypeScript users]: RangeError: Maximum call stack size exceeded #191

Closed
nodkz opened this issue May 3, 2019 · 2 comments
Closed
Labels

Comments

@nodkz
Copy link
Member

nodkz commented May 3, 2019

If you got RangeError: Maximum call stack size exceeded with graphql-compose@7.0.0 under TypeScript when building your app via tsc:

> 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)

Congrats! 🎉 You reach some uncovered by TypeScript situation. It very strange behavior and happens very rare.

The issue about this problem already open in typescript repo: microsoft/TypeScript#31230

Workaround:

Try to find self-referenced types (User used User) and mark them as any:

User.addResolver({
-  type: User,
+  type: User as any, 
});

After that tsc should work normally.

@JadenH
Copy link

JadenH commented May 23, 2019

I am currently running into this. Does this occur if the type is cloned?

@nodkz nodkz closed this as completed in 53289c6 Nov 25, 2019
@nodkz
Copy link
Member Author

nodkz commented Nov 25, 2019

🎉 This issue has been resolved in version 7.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nodkz nodkz added the released label Nov 25, 2019
nodkz added a commit that referenced this issue Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants