Skip to content
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

TS Server fatal error: Cannot read property 'getSourceFiles' of undefined #45899

Open
9monsters opened this issue Sep 8, 2021 · 1 comment
Open
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@9monsters
Copy link

Issue Type: Bug

❗️❗️❗️ Please fill in the sections below to help us diagnose the issue ❗️❗️❗️

TypeScript Version: 4.4.2

Steps to reproduce crash
1.
2.
3.

TS Server Log
❗️Server logging disabled. To help us fix crashes like this, please enable logging by setting:

"typescript.tsserver.log": "verbose"

After enabling this setting, future crash reports will include the server log.

TS Server Error Stack
Server: semantic

TypeError: Cannot read property 'getSourceFiles' of undefined
    at ConfiguredProject.Project.getScriptInfos (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:161481:44)
    at ProjectService.sendProjectTelemetry (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:164287:66)
    at ConfiguredProject.updateGraph (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:162641:37)
    at ProjectService.createLoadAndUpdateConfiguredProject (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:164361:25)
    at ProjectService.assignProjectToOpenedScriptInfo (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165444:44)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165784:97
    at Object.flatMap (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:519:25)
    at ProjectService.applyChangesInOpenFiles (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165784:41)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:166942:46)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:168873:88
    at IOSession.Session.executeWithRequestId (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:168864:28)
    at IOSession.Session.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:168873:33)
    at IOSession.Session.onMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:168899:35)
    at Interface.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:171504:31)
    at Interface.emit (events.js:315:20)
    at Interface._onLine (readline.js:337:10)
    at Interface._normalWrite (readline.js:482:12)
    at Socket.ondata (readline.js:194:10)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

VS Code version: Code 1.60.0 (e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff, 2021-09-01T10:54:53.442Z)
OS version: Darwin x64 20.6.0
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 x 2600)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 14, 18, 17
Memory (System) 16.00GB (2.58GB free)
Process Argv --crash-reporter-id 505ea8f8-eef9-40c4-8707-5498e8baa1e6
Screen Reader no
VM 0%
Extensions (53)
Extension Author (truncated) Version
better-comments aar 2.1.0
iconify ant 0.1.1
vscode-changelog-generator axe 1.0.4
vscode-tailwindcss bra 0.6.14
language-postcss cpy 1.1.0
dart-code Dar 3.26.0
flutter Dar 3.26.0
vscode-markdownlint Dav 0.43.2
vscode-eslint dba 2.1.23
xml Dot 2.5.1
prettier-vscode esb 8.1.0
shell-format fox 7.1.0
copilot Git 1.4.2586
remotehub Git 0.14.0
headwind hey 1.7.0
svg joc 1.4.9
volar joh 0.27.16
i18n-ally lok 2.8.0
Kotlin mat 1.7.1
rainbow-csv mec 1.9.1
dotenv mik 1.0.1
vscode-less mrm 0.6.3
vscode-docker ms- 1.16.1
vscode-language-pack-zh-hans MS- 1.60.3
vscode-kubernetes-tools ms- 1.3.3
python ms- 2021.9.1191016588
vscode-pylance ms- 2021.9.0
jupyter ms- 2021.8.2031190714
jupyter-keymap ms- 1.0.0
remote-containers ms- 0.194.0
debugger-for-chrome msj 4.13.0
vetur oct 0.34.1
vscode-jest Ort 4.1.2
vscode-boot-dev-pack Piv 0.1.0
vscode-concourse Piv 1.27.0
vscode-manifest-yaml Piv 1.27.0
vscode-spring-boot Piv 1.27.0
fabric8-analytics red 0.3.3
java red 0.81.0
vscode-commons red 0.0.6
vscode-xml red 0.18.0
vscode-yaml red 0.22.0
vscode-stylelint sty 0.86.0
language-stylus sys 1.13.0
vscode-java-debug vsc 0.35.0
vscode-java-dependency vsc 0.18.7
vscode-java-pack vsc 0.18.4
vscode-java-test vsc 0.31.3
vscode-maven vsc 0.33.0
vscode-spring-boot-dashboard vsc 0.2.0
vscode-spring-initializr vsc 0.7.0
vscode-icons vsc 11.6.0
vue-language-features znc 0.7.6
@mjbvz mjbvz transferred this issue from microsoft/vscode Sep 15, 2021
@mjbvz mjbvz removed their assignment Sep 15, 2021
@mjbvz
Copy link
Contributor

mjbvz commented Sep 15, 2021

Please try collecting the TS Server log from the crashed instance:

  1. Set "typescript.tsserver.log": "verbose"

  2. Restart VS Code and reproduce the problem

  3. Open the TypeScript section of the output panel

  4. At the very top, find the first line that prints to path to the semantic error log file. It should look something like:

    [Info  - 19:54:59.247] <semantic> Log file: /Users/matb/Library/Application Support/Code - Insiders/logs/20200213T104930/exthost55/vscode.typescript-language-features/tsserver-log-ZT2zau/tsserver.log
    

    That file contains the typescript logs.

Look through that log file for the first error or stack trace you see. If you can share the log, I can also take a look to see if anything stands out

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

@andrewbranch andrewbranch added the Needs More Info The issue still hasn't been fully clarified label Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

No branches or pull requests

3 participants