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

TSServer Crash #34

Open
justinbhopper opened this issue Feb 10, 2021 · 0 comments
Open

TSServer Crash #34

justinbhopper opened this issue Feb 10, 2021 · 0 comments

Comments

@justinbhopper
Copy link

justinbhopper commented Feb 10, 2021

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant