microsoft / TypeScript

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

TS Server fatal error: re.test is not a function #37939

Closed deadbaed closed 1 month ago

deadbaed commented 4 years ago

Issue Type: Bug

TypeScript Version: 3.8.3 Steps to reproduce crash

  1. right click on folder and click copy
  2. paste folder
  3. error TS Server Error Stack
    TypeError: re.test is not a function
    at tsserver.js:28353:103
    at Object.findIndex (tsserver.js:289:17)
    at _loop_5 (tsserver.js:28353:43)
    at Object.getFileNamesFromConfigSpecs (tsserver.js:28383:17)
    at ProjectService.reloadFileNamesOfConfiguredProject (tsserver.js:142386:42)
    at ConfiguredProject.updateGraph (tsserver.js:140644:54)
    at updateProjectIfDirty (tsserver.js:141076:45)
    at ProjectService.assignProjectToOpenedScriptInfo (tsserver.js:143114:29)
    at tsserver.js:143396:107
    at Object.mapDefined (tsserver.js:562:30)
    at ProjectService.applyChangesInOpenFiles (tsserver.js:143396:48)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:144260:46)
    at tsserver.js:146003:88
    at IOSession.Session.executeWithRequestId (tsserver.js:145994:28)
    at IOSession.Session.executeCommand (tsserver.js:146003:33)
    at IOSession.Session.onMessage (tsserver.js:146027:35)
    at Interface.<anonymous> (tsserver.js:147342:27)
    at Interface.emit (events.js:203:13)
    at Interface._onLine (readline.js:316:10)
    at Interface._normalWrite (readline.js:461:12)
    at Socket.ondata (readline.js:172:10)
    at Socket.emit (events.js:203:13)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at Socket.Readable.push (_stream_readable.js:210:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)

VS Code version: Code - OSS 1.44.0 (2aae1f26c72891c399f860409176fe435a154b13, 2020-04-08T19:57:59.162Z) OS version: Linux x64 5.6.3-arch1-1

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 4000)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: unavailable_off
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 2| |Memory (System)|31.14GB (16.34GB free)| |Process Argv|--no-sandbox --unity-launch --no-sandbox| |Screen Reader|no| |VM|0%|
Extensions (44) Extension|Author (truncated)|Version ---|---|--- language-x86-64-assembly|13x|2.3.0 easy-cpp-projects|ACh|1.7.7 project-manager|ale|10.11.0 vscode-deno|axe|3.5.1 better-toml|bun|0.3.2 npm-intellisense|chr|1.3.0 gitignore|cod|0.6.0 doxdocgen|csc|0.6.0 javascript-ejs-support|Dig|1.3.1 git-extension-pack|don|0.1.3 githistory|don|0.6.3 vscode-ghc-simple|dra|0.1.19 gitlens|eam|10.2.1 EditorConfig|Edi|0.14.5 vscode-npm-script|eg2|0.3.11 vsc-material-theme|Equ|32.5.0 vsc-material-theme-icons|equ|1.1.4 carbon-now-sh|eri|1.2.0 cpp-class-creator|Fle|0.7.0 todo-tree|Gru|0.0.171 discord-vscode|icr|3.13.0 c-cpp-flylint|jbe|1.4.1 better-cpp-syntax|jef|1.14.29 language-haskell|jus|2.7.0 node-module-intellisense|lei|1.5.0 vscode-docker|ms-|1.0.0 cpptools|ms-|0.27.0 Go|ms-|0.13.1 vscode-typescript-tslint-plugin|ms-|1.2.3 epitech-c-cpp-headers|nic|1.14.0 vetur|oct|0.24.0 rust|rus|0.7.0 crates|ser|0.4.9 code-settings-sync|Sha|3.4.3 trailing-spaces|sha|0.3.1 vscode-spotify|shy|3.1.0 code-spell-checker|str|1.8.0 code-spell-checker-french|str|0.1.6 code-spell-checker-russian|str|0.2.4 vscode-icons|vsc|10.1.1 vim|vsc|1.13.1 vscode-todo-highlight|way|1.0.4 change-case|wma|1.0.0 vscode-open-in-github|ziy|1.3.6 (1 theme extensions excluded)
sheetalkamat commented 4 years ago

We need more concrete steps to repro this with file and folder structure and contents of the file. I cannot repro this following the currently mentioned steps. Also please upload tsserver log when you repro this so we can investigate this. You can upload logs by following these steps:

  1. Set "typescript.tsserver.log": "verbose"
  2. Restart vscode or vscode insiders
  3. Reproduce the problem
  4. In vscode or vscode insiders, run the TypeScript: Open TS Server log command
  5. This should open a large file called tsserver.log. Please share this file. Additionally you can also share file ti.log created next to it.
deadbaed commented 4 years ago

well i tried to repeat what i did to reproduce the bug, but i could not reproduce it on my machine... but if the bug happens again i will provide more information.