Skip to content

TS Server fatal error: Cannot read property 'lastIndexOf' of undefined #45875

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

Closed
jonhamm opened this issue Sep 10, 2021 · 1 comment
Closed
Labels
Duplicate An existing issue was already created

Comments

@jonhamm
Copy link

jonhamm commented Sep 10, 2021

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 'lastIndexOf' of undefined
    at Object.startsWith (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:2064:20)
    at isNodeModulesOrScopedPackageDirectory (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:19715:65)
    at guessDirectorySymlink (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:19703:17)
    at processResolution (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:19692:22)
    at /Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:19683:162
    at Map.forEach (<anonymous>)
    at Object.setSymlinksFromResolutions (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:19683:123)
    at ConfiguredProject.Project.getSymlinkCache (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:161077:35)
    at Object.getSymlinkCache (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:114006:29)
    at Object.host.compilerHost.realpath (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:114071:36)
    at realPath (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:41680:42)
    at Object.resolveTypeReferenceDirective (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:41044:74)
    at /Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:162436:112
    at Object.map (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:455:29)
    at Function.AutoImportProviderProject.getRootFileNames (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:162436:42)
    at Function.AutoImportProviderProject.create (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:162468:38)
    at ConfiguredProject.Project.getPackageJsonAutoImportProvider (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:162270:77)
    at ConfiguredProject.Project.updateGraph (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:161693:26)
    at ConfiguredProject.updateGraph (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:162637:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:164361:25)
    at ProjectService.assignProjectToOpenedScriptInfo (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165444:44)
    at /Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:165784:97
    at Object.flatMap (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:519:25)
    at ProjectService.applyChangesInOpenFiles (/Applications/Visual Studio Code 3.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 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:166942:46)
    at /Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:168873:88
    at IOSession.Session.executeWithRequestId (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:168864:28)
    at IOSession.Session.executeCommand (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:168873:33)
    at IOSession.Session.onMessage (/Applications/Visual Studio Code 3.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:168899:35)
    at Interface.<anonymous> (/Applications/Visual Studio Code 3.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) i9-9880H CPU @ 2.30GHz (16 x 2300)
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) 21, 15, 13
Memory (System) 32.00GB (3.54GB free)
Process Argv . --crash-reporter-id df8be54c-59c4-4504-bc1e-3035eb0968b5
Screen Reader no
VM 0%
Extensions (39)
Extension Author (truncated) Version
cucumberautocomplete ale 2.15.1
ng-template Ang 12.2.0
npm-intellisense chr 1.4.0
vscode-eslint dba 2.1.25
gitlens eam 11.6.0
EditorConfig Edi 0.16.4
vscode-npm-script eg2 0.3.22
prettier-vscode esb 8.1.0
vscode-jest-runner fir 0.4.47
angular2-switcher inf 0.3.4
search-node-modules jas 1.3.0
angular-essentials joh 12.0.0
Angular2 joh 12.0.0
vscode-peacock joh 3.9.1
bash-ide-vscode mad 1.11.0
Angular-BeastCode Mik 10.0.3
vscode-docker ms- 1.16.1
vscode-kubernetes-tools ms- 1.3.3
python ms- 2021.9.1218897484
vscode-pylance ms- 2021.9.1
jupyter ms- 2021.8.2041215044
jupyter-keymap ms- 1.0.0
remote-containers ms- 0.194.0
debugger-for-chrome msj 4.13.0
debugger-for-edge msj 1.0.15
angular-console nrw 17.10.0
vscode-concourse Piv 1.27.0
material-icon-theme PKi 4.10.0
vscode-commons red 0.0.6
vscode-yaml red 0.22.0
vscode-coverage-gutters rya 2.8.1
annotator ryu 1.0.0
node-modules-viewer see 0.0.5
sonarlint-vscode Son 2.2.0
autoimport ste 1.5.4
move-ts str 1.12.0
sort-lines Tyr 1.9.0
vscode-java-debug vsc 0.35.0
markdown-all-in-one yzh 3.4.0

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyt639:30300192
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30358480
pythondataviewer:30285071
pythonvsuse255:30340121
vscod805cf:30301675
pythonvspyt200:30340761
vscextlangct:30333562
binariesv615:30325510
vsccppwt:30364497
pythonvssor306:30344512
bridge0708:30335490
pygetstartedt2:30360495
bridge0723:30353136
pythonrunftest32:30364559
pythonf5test824cf:30361778
javagetstartedc:30364665
pythonvspyt187cf:30362783
pydsgsc2:30361791
vscus224:30358039
vssid140cf:30363604

@mjbvz mjbvz transferred this issue from microsoft/vscode Sep 14, 2021
@mjbvz mjbvz removed their assignment Sep 14, 2021
@andrewbranch
Copy link
Member

Duplicate of #44953

@andrewbranch andrewbranch marked this as a duplicate of #44953 Sep 14, 2021
@andrewbranch andrewbranch added the Duplicate An existing issue was already created label Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants