Skip to content

"RangeError: Maximum call stack exceeded" on JSDoc typedef of function #39647

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

Closed
michaelfig opened this issue Jul 17, 2020 · 2 comments
Closed
Labels
Duplicate An existing issue was already created

Comments

@michaelfig
Copy link

TypeScript Version: Version 4.0.0-dev.20200717

Search Terms: Maximum call stack

Code

jsconfig.json:

{
  "compilerOptions": {
    "noEmit": false,
    "emitDeclarationOnly": true,
  },
  "include": ["src/*.js"],
}

src/foo.js:

/**
 * @typedef {import('./bar').bar} bar
 */

src/bar.js:

export function bar() {
  return 'hello';
}

Run: tsc -p jsconfig.json

Expected behavior:

Generate .d.ts files, or at least, don't crash.

Actual behavior:

$ tsc -p jsconfig.json 
/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:84647
                throw e;
                ^

RangeError: Maximum call stack size exceeded
    at getTypeOfFuncClassEnumModule (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:40811:25)
    at getTypeOfSymbol (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:40924:24)
    at getTypeFromJSDocValueReference (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:43656:33)
    at getTypeReferenceType (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:43642:33)
    at getTypeFromJSDocValueReference (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:43670:36)
    at getTypeReferenceType (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:43642:33)
    at getTypeFromJSDocValueReference (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:43670:36)
    at getTypeReferenceType (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:43642:33)
    at getTypeFromJSDocValueReference (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:43670:36)
    at getTypeReferenceType (/Users/michael/.config/yarn/global/node_modules/typescript/lib/tsc.js:43642:33)

Playground Link:

Couldn't figure out how to do multiple JSDoc files in the playground.

Related Issues:

Not that I could tell.

@orta orta added the Duplicate An existing issue was already created label Jul 18, 2020
@orta
Copy link
Contributor

orta commented Jul 18, 2020

Thanks this is a dupe of #36830

( It includes some workarounds too )

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants