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

Closed
jimmy3912msncom opened this issue Mar 12, 2021 · 5 comments
Closed
Assignees
Labels
Duplicate An existing issue was already created

Comments

@jimmy3912msncom
Copy link

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

TypeScript Version: 4.2.3
VS Code Version: 1.54.2

Steps to reproduce crash

  1. Open VS Code and go to typescript file
  2. No intellisense works
  3. After awhile the crash popup shows up

TS Server Log
❗️ Please review and upload this log file to help us diagnose this crash:
c:\Users\jimmytu\AppData\Roaming\Code\logs\20210312T133030\exthost1\vscode.typescript-language-features\tsserver-log-qNXW6G\tsserver.log
The log file may contain personal data, including full paths and source code from your workspace. You can scrub the log file to remove paths or other personal information.

TS Server Error Stack
Server: semantic

TypeError: Cannot read property 'lastIndexOf' of undefined
    at Object.startsWith (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:2024:20)
    at isNodeModulesOrScopedPackageDirectory (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19068:65)
    at guessDirectorySymlink (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19056:17)
    at Object.discoverProbableSymlinks (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19044:22)
    at ConfiguredProject.Project.getSymlinkCache (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:153461:61)
    at Object.getSymlinkCache (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:108825:29)
    at fileOrDirectoryExistsUsingSource (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:108956:37)
    at Object.host.compilerHost.directoryExists (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:108868:24)
    at Object.directoryProbablyExists (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:18100:46)
    at c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39096:46
    at Object.firstDefined (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:220:26)
    at primaryLookup (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39093:27)
    at Object.resolveTypeReferenceDirective (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39066:24)
    at c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154817:112
    at Object.map (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:451:29)
    at Function.AutoImportProviderProject.getRootFileNames (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154817:42)
    at Function.AutoImportProviderProject.create (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154846:38)
    at ConfiguredProject.Project.getPackageJsonAutoImportProvider (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154660:77)
    at ConfiguredProject.Project.updateGraph (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154058:26)
    at ConfiguredProject.updateGraph (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154993:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:156743:25)
    at ProjectService.assignProjectToOpenedScriptInfo (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:157684:44)
    at c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:158024:97
    at Object.flatMap (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:515:25)
    at ProjectService.applyChangesInOpenFiles (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:158024:41)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:159079:46)
    at c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160963:88
    at IOSession.Session.executeWithRequestId (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160954:28)
    at IOSession.Session.executeCommand (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160963:33)
    at IOSession.Session.onMessage (c:\Users\jimmytu\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160989:35)
    at Interface.<anonymous> (c:\Users\jimmytu\AppData\Local\Programs\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)

System info

CPUs Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz (12 x 3592)
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)  
Memory (System) 31.92GB (15.22GB free)
Process Argv --crash-reporter-id ef8d5b0b-99c3-48d8-88c7-de6e8d0c4c9c
Screen Reader no
VM 0%
Extension Author (truncated) Version
vscode-eslint dba 2.1.17
csharp ms- 1.23.9
code-spell-checker str 1.10.2

A/B experiment info

vsins829:30139715
vsliv368:30146709
vsreu685:30147344
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt875:30259475
vspre833:30267464
vsdfh931:30275552

@vscodebot
Copy link

vscodebot bot commented Mar 12, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@jimmy3912msncom
Copy link
Author

tsserver.log

@jimmy3912msncom
Copy link
Author

I rolled back to VS code version 1.53.2 which had typescript version 4.1.5 and everything started working again

@mjbvz mjbvz transferred this issue from microsoft/vscode Mar 15, 2021
@mjbvz mjbvz removed their assignment Mar 15, 2021
@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Mar 15, 2021
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.3.0 milestone Mar 15, 2021
@IllusionMH
Copy link
Contributor

Duplicate of #43105

@sheetalkamat sheetalkamat added Duplicate An existing issue was already created and removed Needs Investigation This issue needs a team member to investigate its status. labels Mar 15, 2021
@sheetalkamat sheetalkamat assigned orta and unassigned sheetalkamat Mar 15, 2021
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

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

7 participants