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 #120492

Closed
Zhangyao719 opened this issue Apr 4, 2021 · 2 comments
Closed
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@Zhangyao719
Copy link

Issue Type: Bug

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

TypeScript Version: 4.2.3

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 (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:2024:20)
    at isNodeModulesOrScopedPackageDirectory (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19068:65)
    at guessDirectorySymlink (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19056:17)
    at Object.discoverProbableSymlinks (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19044:22)
    at ConfiguredProject.Project.getSymlinkCache (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:153461:61)
    at Object.getSymlinkCache (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:108825:29)
    at Object.host.compilerHost.realpath (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:108884:36)
    at realPath (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39626:42)
    at Object.resolveTypeReferenceDirective (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39075:74)
    at d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154817:112
    at Object.map (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:451:29)
    at Function.AutoImportProviderProject.getRootFileNames (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154817:42)
    at Function.AutoImportProviderProject.create (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154846:38)
    at ConfiguredProject.Project.getPackageJsonAutoImportProvider (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154660:77)
    at ConfiguredProject.Project.updateGraph (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154058:26)
    at ConfiguredProject.updateGraph (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154993:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:156743:25)
    at ProjectService.assignProjectToOpenedScriptInfo (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:157684:44)
    at d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:158024:97
    at Object.flatMap (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:515:25)
    at ProjectService.applyChangesInOpenFiles (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:158024:41)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:159079:46)
    at d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160963:88
    at IOSession.Session.executeWithRequestId (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160954:28)
    at IOSession.Session.executeCommand (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160963:33)
    at IOSession.Session.onMessage (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160989:35)
    at Interface.<anonymous> (d:\前端软件\vscode\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:163650: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.3 (2b9aebd, 2021-03-15T10:55:45.459Z)
OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz (8 x 2400)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 7.81GB (2.43GB free)
Process Argv --crash-reporter-id 7b3221ae-03f4-4f12-a89c-aa3b34822bdc
Screen Reader no
VM 0%
Extensions (20)
Extension Author (truncated) Version
eggjs ati 0.3.1
turbo-console-log Cha 2.1.6
bracket-pair-colorizer Coe 1.0.61
vscode-eslint dba 2.1.19
gitlens eam 11.3.0
vscode-html-css ecm 1.10.2
prettier-vscode esb 6.3.1
auto-rename-tag for 0.1.6
vue-snippets hol 1.0.4
dotenv mik 1.0.1
easy-less mrc 1.7.2
vscode-language-pack-zh-hans MS- 1.54.2
debugger-for-chrome msj 4.12.12
vetur oct 0.33.1
open-html-in-browser pea 2.1.3
vscode-css-peek pra 4.1.3
LiveServer rit 5.6.1
tabnine-vscode Tab 3.2.12
open-in-browser tec 2.0.0
vscode-icons vsc 11.3.0
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvsdeb440:30248342
pythonvsded773:30248341
vstes627:30244334
pythonvspyt875:30259475
pythonvsnew554:30281908
pythontb:30283811
openwslfolder:30282073
vspre833:30267464
pythonptprofiler:30281270
vshan820cf:30276953
pythondataviewer:30283453

@IllusionMH
Copy link
Contributor

/duplicate of #118335

Latest info can be found in microsoft/TypeScript#43105 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators May 19, 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

4 participants
@IllusionMH @mjbvz @Zhangyao719 and others