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 'lastIndexOf' of undefined #118560

Closed
xman892 opened this issue Mar 9, 2021 · 3 comments
Closed

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

xman892 opened this issue Mar 9, 2021 · 3 comments
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@xman892
Copy link

xman892 commented Mar 9, 2021

Issue Type: Bug

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

TypeScript Version: 4.2.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 (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:2024:20)
    at isNodeModulesOrScopedPackageDirectory (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19068:65)
    at guessDirectorySymlink (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19056:17)
    at Object.discoverProbableSymlinks (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19044:22)
    at ConfiguredProject.Project.getSymlinkCache (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:153426:61)
    at Object.getSymlinkCache (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:108820:29)
    at Object.host.compilerHost.realpath (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:108879:36)
    at realPath (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39626:42)
    at Object.resolveTypeReferenceDirective (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39075:74)
    at c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154782:112
    at Object.map (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:451:29)
    at Function.AutoImportProviderProject.getRootFileNames (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154782:42)
    at Function.AutoImportProviderProject.create (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154811:38)
    at ConfiguredProject.Project.getPackageJsonAutoImportProvider (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154625:77)
    at ConfiguredProject.Project.updateGraph (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154023:26)
    at ConfiguredProject.updateGraph (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154958:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:156708:25)
    at ProjectService.assignProjectToOpenedScriptInfo (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:157649:44)
    at c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:157989:97
    at Object.flatMap (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:515:25)
    at ProjectService.applyChangesInOpenFiles (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:157989:41)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:159044:46)
    at c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160928:88
    at IOSession.Session.executeWithRequestId (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160919:28)
    at IOSession.Session.executeCommand (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160928:33)
    at IOSession.Session.onMessage (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160954:35)
    at Interface.<anonymous> (c:\Users\r_tri\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:163615:31)
    at Interface.emit (events.js:315:20)
    at Interface._onLine (readline.js:329:10)
    at Interface._normalWrite (readline.js:474:12)
    at Socket.ondata (readline.js:186:10)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

VS Code version: Code 1.54.1 (f30a9b7, 2021-03-04T22:38:31.419Z)
OS version: Windows_NT x64 10.0.19041

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.92GB (8.50GB free)
Process Argv --crash-reporter-id cf1d6f20-8afa-4ddd-8f18-ff09194c103e
Screen Reader no
VM 0%
Extensions (19)
Extension Author (truncated) Version
better-comments aar 2.1.0
aws-toolkit-vscode ama 1.20.0
npm-intellisense chr 1.3.1
vscode-devtools-for-chrome cod 0.0.7
bracket-pair-colorizer Coe 1.0.61
vscode-eslint dba 2.1.14
xml Dot 2.5.1
gitlens eam 11.3.0
vscode-npm-script eg2 0.3.16
vs-code-xml-format fab 0.1.5
vscode-jest-runner fir 0.4.31
vscode-pull-request-github Git 0.24.0
live-html-previewer hdg 0.3.0
rest-client hum 0.24.4
aws-cli-configure mar 0.3.0
dynamicsmobile-vscode Mob 0.0.2
debugger-for-chrome msj 4.12.12
ayu tea 0.20.1
tempotimetracking tem 1.0.0

(5 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vstry914:30256638
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
dockersubset:30265998
pythontb:30265425
vspre833:30267464

@IllusionMH
Copy link
Contributor

/duplicate of #118335

@github-actions github-actions bot locked and limited conversation to collaborators Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

3 participants
@xman892 @IllusionMH and others