TSServer Crash
justinbhopper opened this issue · 0 comments
justinbhopper commented
I'm not at all totally sure what the root of the issue was, but I believe a recent update to TSServer caused crashing in our code when using zerollup. The tsserver logs seemed to be blowing up about the missing name.
I resolved the issue by adding a name
property to the plugins entry in my tsconfig.json. I'm posting here in case anyone else runs into this issue.
tsconfig.json
before:
{
...
"plugins": [{ "transform": "@zerollup/ts-transform-paths" }],
}
tsconfig.json
after:
{
...
"plugins": [{ "name": "zerollup", "transform": "@zerollup/ts-transform-paths" }],
}
Here is a snippet of my tsserver logs in case this helps give context:
Info 136 [09:36:31.009] Enabling plugin undefined from candidate paths: c:/Users/justi/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/tsserver.js/../../..,c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features,c:\Users\justi\.vscode\extensions\jpoissonnier.vscode-styled-components-1.5.0
Err 137 [09:36:31.009] Exception on executing command {"seq":8,"type":"request","command":"updateOpen","arguments":{"changedFiles":[],"closedFiles":[]]}}:
Cannot read property 'indexOf' of undefined
TypeError: Cannot read property 'indexOf' of undefined
at Object.parsePackageName (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:39472:30)
at ConfiguredProject.Project.enablePlugin (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:151962:24)
at ConfiguredProject.enablePluginsWithOptions (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:152477:30)
at ProjectService.loadConfiguredProject (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154206:25)
at ProjectService.createAndLoadConfiguredProject (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154145:22)
at ProjectService.createLoadAndUpdateConfiguredProject (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:154150:36)
at ProjectService.assignProjectToOpenedScriptInfo (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:155055:44)
at c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:155395:97
at Object.flatMap (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:513:25)
at ProjectService.applyChangesInOpenFiles (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:155395:41)
at Session.handlers.ts.Map.ts.getEntries._a.<computed> (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:156413:46)
at c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:158286:88
at IOSession.Session.executeWithRequestId (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:158277:28)
at IOSession.Session.executeCommand (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:158286:33)
at IOSession.Session.onMessage (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:158310:35)
at Interface.<anonymous> (c:\Users\justi\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:160520:27)
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)