type-coverage: Maximum call stack size exceeded

Hello,

I have a few users getting a RangeError: Maximum call stack size exceeded when running the typescript-coverage-report command, but (as you’ll see from https://github.com/alexcanessa/typescript-coverage-report/issues/51#issuecomment-811443024) seems like the bug happens also when running type-coverage directly.

Anyone else?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Alright, had time to investigate a bit and found out the the issue is with this fallback as my tsconfig has neither includes nor files. So that generic wildcard '**/*' was matching things like md,json,png, sh, … and I guess TS would choke trying to read some of them, never finishing the type check and eating all the memory. By setting an explicit includes: ['**/*.{ts,tsx}'] in my tsconfig then TS would handle 50K files just fine, and the program would perform decently.

Wonder if that is what is causing issues to other people here too and if we should make it a bit more specific.

According to typescript document (https://www.typescriptlang.org/tsconfig#include ), if files is not specified, the default value of include is ** 屏幕快照 2022-04-27 11 24 15 And typescript will support .mts and cts, so **/*.{ts,tsx} will break.

@Yonom Can you provide a minimal repo to produce this?