microsoft / TypeScript

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

TS Server fatal error: Cannot read property 'get' of undefined #38889

Closed shandysiswandi closed 4 years ago

shandysiswandi commented 4 years ago

Issue Type: Bug

TypeScript Version: 3.8.3 Steps to reproduce crash 1. 2. 3. TS Server Error Stack

TypeError: Cannot read property 'get' of undefined
    at resolveModuleNamesReusingOldState (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98026:92)
    at processImportedModules (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99448:35)
    at findSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99191:17)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:85
    at getSourceFileFromReferenceWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98987:34)
    at processSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:13)
    at processRootFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98843:13)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99418:21
    at Object.forEach (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167:30)
    at processLibReferenceDirectives (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99413:16)
    at findSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99188:21)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:85
    at getSourceFileFromReferenceWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98987:34)
    at processSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:13)
    at processRootFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98843:13)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99418:21
    at Object.forEach (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167:30)
    at processLibReferenceDirectives (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99413:16)
    at findSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99188:21)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:85
    at getSourceFileFromReferenceWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98987:34)
    at processSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:13)
    at processRootFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98843:13)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99418:21
    at Object.forEach (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167:30)
    at processLibReferenceDirectives (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99413:16)
    at findSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99188:21)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:85
    at getSourceFileFromReferenceWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98987:34)
    at processSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:13)
    at processRootFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98843:13)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99418:21
    at Object.forEach (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167:30)
    at processLibReferenceDirectives (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99413:16)
    at findSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99188:21)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:85
    at getSourceFileFromReferenceWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98987:34)
    at processSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:13)
    at processRootFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98843:13)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99418:21
    at Object.forEach (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167:30)
    at processLibReferenceDirectives (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99413:16)
    at findSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99188:21)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:85
    at getSourceFileFromReferenceWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98987:34)
    at processSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:13)
    at processRootFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98843:13)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99418:21
    at Object.forEach (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167:30)
    at processLibReferenceDirectives (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99413:16)
    at findSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99188:21)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:85
    at getSourceFileFromReferenceWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98987:34)
    at processSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:13)
    at processRootFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98843:13)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99418:21
    at Object.forEach (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167:30)
    at processLibReferenceDirectives (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99413:16)
    at findSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99188:21)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:85
    at getSourceFileFromReferenceWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98987:34)
    at processSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:13)
    at processRootFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98843:13)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99418:21
    at Object.forEach (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167:30)
    at processLibReferenceDirectives (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99413:16)
    at findSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99188:21)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:85
    at getSourceFileFromReferenceWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98987:34)
    at processSourceFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:99020:13)
    at processRootFile (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:98843:13)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:97809:60
    at Object.forEach (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:167:30)
    at Object.createProgram (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:97809:16)
    at synchronizeHostData (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:135218:26)
    at Proxy.getProgram (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:135310:13)
    at InferredProject.Project.updateGraphWorker (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:139786:53)
    at InferredProject.Project.updateGraph (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:139729:42)
    at updateProjectIfDirty (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:141076:45)
    at Array.forEach (<anonymous>)
    at ProjectService.assignProjectToOpenedScriptInfo (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:143127:41)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:143396:107
    at Object.mapDefined (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:562:30)
    at ProjectService.applyChangesInOpenFiles (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:143396:48)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:144260:46)
    at c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:146003:88
    at IOSession.Session.executeWithRequestId (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:145994:28)
    at IOSession.Session.executeCommand (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:146003:33)
    at IOSession.Session.onMessage (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:146027:35)
    at Interface.<anonymous> (c:\Users\sandy\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\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 1.45.1 (5763d909d5f12fe19f215cbfdd29a91c0fa9208a, 2020-05-14T08:27:35.169Z) OS version: Windows_NT x64 10.0.18363

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i3-1005G1 CPU @ 1.20GHz (4 x 1190)| |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: enabled
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)|undefined| |Memory (System)|15.76GB (8.00GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (19) Extension|Author (truncated)|Version ---|---|--- vscode-intelephense-client|bme|1.2.3 path-intellisense|chr|1.4.2 laravel-goto-view|cod|1.3.2 vscode-eslint|dba|2.1.5 vscode-deno|den|1.24.0 gitlens|eam|10.2.1 EditorConfig|Edi|0.15.1 prettier-vscode|esb|4.7.0 auto-rename-tag|for|0.1.3 Kotlin|mat|1.7.1 dotenv|mik|1.0.1 mssql|ms-|1.9.0 vscode-typescript-tslint-plugin|ms-|1.2.3 vsliveshare|ms-|1.0.2236 laravel-blade|one|1.21.0 laravel-extension-pack|one|0.6.1 laravel5-snippets|one|1.8.0 material-icon-theme|PKi|4.1.0 laravel-artisan|rya|0.0.27
mjbvz commented 4 years ago

Does this reproduce in the latest VS Code insiders build which includes TypeScript 3.9?

shandysiswandi commented 4 years ago

image

mjbvz commented 4 years ago

Try VS code insiders (1.46)