microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101k stars 12.48k forks source link

TS Server fatal error: Maximum call stack size exceeded #39321

Closed redstone-dev closed 3 months ago

redstone-dev commented 4 years ago

Issue Type: Bug

TypeScript Version: 4.0.0-dev.20200627 Steps to reproduce crash

  1. Open up VS Code
  2. Watch the terminal
  3. The TS server will crash automatically TS Server Error Stack
    RangeError: Maximum call stack size exceeded
    at toFileNameLowerCase (tsserver.js:1514:40)
    at Object.toPath (tsserver.js:6664:16)
    at ProjectService.toPath (tsserver.js:148594:27)
    at tsserver.js:151326:56
    at Object.forEachAncestorDirectory (tsserver.js:6868:26)
    at Object.searchDirectoryAndAncestors (tsserver.js:151322:24)
    at processDirectory (tsserver.js:151219:46)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)
    at processDirectory (tsserver.js:151220:36)

VS Code version: Code 1.44.2 (ff915844119ce9485abfe8aa9076ec76b5300ddd, 2020-04-16T17:07:18.473Z) OS version: Darwin x64 18.7.0

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz (4 x 1800)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled| |Load (avg)|39, 18, 9| |Memory (System)|8.00GB (0.35GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (14) Extension|Author (truncated)|Version ---|---|--- npm-intellisense|chr|1.3.0 vscode-markdownlint|Dav|0.36.1 xml|Dot|2.5.0 vscode-npm-script|eg2|0.3.12 vsc-material-theme|Equ|32.8.0 vsc-material-theme-icons|equ|1.1.4 prettier-vscode|esb|5.1.0 vscode-google-translate|fun|1.4.5 csharp|ms-|1.22.1 python|ms-|2020.5.86806 vscode-typescript-next|ms-|4.0.20200627 debugger-for-chrome|msj|4.12.8 material-icon-theme|PKi|4.2.0 vscodeintellicode|Vis|1.2.8 (3 theme extensions excluded)
RyanCavanaugh commented 4 years ago

Can you clarify the exact repro steps? What directory are you running this in, what files are present, etc? The stack trace implies there may be symlinks involved somewhere?

JasonKleban commented 3 years ago

This is a different location, but it's probably related, right? I don't know what is causing it, other than a build attempt.

│ RangeError: Maximum call stack size exceeded
│     at Object.getObjectFlags (C:\code\abc\node_modules\.pnpm\typescript@4.2.0-beta\node_modules\typescript\lib\typescript.js:18586:28)
│     at isJSLiteralType (C:\code\abc\node_modules\.pnpm\typescript@4.2.0-beta\node_modules\typescript\lib\typescript.js:56481:20)
│     at isJSLiteralType (C:\code\abc\node_modules\.pnpm\typescript@4.2.0-beta\node_modules\typescript\lib\typescript.js:56491:24)
│     at isJSLiteralType (C:\code\abc\node_modules\.pnpm\typescript@4.2.0-beta\node_modules\typescript\lib\typescript.js:56491:24)
...