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

Closed
rohaanuv opened this issue Mar 12, 2021 · 3 comments
Closed

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

rohaanuv opened this issue Mar 12, 2021 · 3 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) upstream-issue-fixed The underlying upstream issue has been fixed

Comments

@rohaanuv
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 (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:2024:20)
    at isNodeModulesOrScopedPackageDirectory (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19068:65)
    at guessDirectorySymlink (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19056:17)
    at Object.discoverProbableSymlinks (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:19044:22)
    at ConfiguredProject.Project.getSymlinkCache (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:153461:61)
    at Object.getSymlinkCache (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:108825:29)
    at Object.host.compilerHost.realpath (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:108884:36)
    at realPath (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39626:42)
    at Object.resolveTypeReferenceDirective (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39075:74)
    at c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154817:112
    at Object.map (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:451:29)
    at Function.AutoImportProviderProject.getRootFileNames (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154817:42)
    at Function.AutoImportProviderProject.create (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154846:38)
    at ConfiguredProject.Project.getPackageJsonAutoImportProvider (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154660:77)
    at ConfiguredProject.Project.updateGraph (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154058:26)
    at ConfiguredProject.updateGraph (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154993:63)
    at ProjectService.createLoadAndUpdateConfiguredProject (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:156743:25)
    at ProjectService.assignProjectToOpenedScriptInfo (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:157684:44)
    at c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:158024:97
    at Object.flatMap (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:515:25)
    at ProjectService.applyChangesInOpenFiles (c:\Users\rohaa\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\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:159079:46)
    at c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160963:88
    at IOSession.Session.executeWithRequestId (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160954:28)
    at IOSession.Session.executeCommand (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160963:33)
    at IOSession.Session.onMessage (c:\Users\rohaa\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160989:35)
    at Interface.<anonymous> (c:\Users\rohaa\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)

VS Code version: Code 1.54.2 (fd6f3bc, 2021-03-11T00:56:19.848Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz (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: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 7.85GB (2.87GB free)
Process Argv C:\Users\rohaa\AppData\Local\Temp\Temp1_ios.zip\IosAppDevProcessSection\IOSAppDevProcessSection.js --crash-reporter-id 6ad1e51b-a68f-4e28-87da-c2be86411f35
Screen Reader no
VM 0%
Extensions (16)
Extension Author (truncated) Version
vscode-database baj 2.2.3
bracket-pair-colorizer Coe 1.0.61
es7-react-js-snippets dsz 3.1.0
prettier-vscode esb 5.9.2
vscode-styled-components jpo 1.5.0
dotenv mik 1.0.1
csharp ms- 1.23.9
python ms- 2021.2.636928669
jupyter ms- 2021.3.619093157
vscode-typescript-tslint-plugin ms- 1.3.3
material-icon-theme PKi 4.5.0
LiveServer rit 5.6.1
markdown-preview-enhanced shd 0.5.16
vscodeintellicode Vis 1.2.11
expresssnippet vla 0.2.4
JavaScriptSnippets xab 1.8.0
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstry244cf:30256637
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
dockersubset:30270708
vspre833cf:30267465

@gjsjohnmurray
Copy link
Contributor

Looks like the upstream issue is microsoft/TypeScript#43105 and yesterday's VS Code update to 1.54.2 still has it because it only brings 4.2.3 and the fix isn't expected until 4.3.1 😞

@mjbvz mjbvz added *duplicate Issue identified as a duplicate of another issue(s) upstream-issue-fixed The underlying upstream issue has been fixed labels Mar 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 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) upstream-issue-fixed The underlying upstream issue has been fixed
Projects
None yet
Development

No branches or pull requests

4 participants
@gjsjohnmurray @mjbvz @rohaanuv and others