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: Did not expect SourceFile to have an Identifier in its trivia #26624

Closed
Pajn opened this issue Aug 23, 2018 · 1 comment
Closed
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@Pajn
Copy link

Pajn commented Aug 23, 2018

TypeScript Version: 3.0.1 (I think, what's included in vscode 1.26.1)

Search Terms:
Did not expect SourceFile to have an Identifier in its trivia

Code

// @ts-check

/**
 * @typedef {{[key in K]: Array<V>} & {total_count: number, offset: number, limit: number}} Paged
 * @template {string} K
 * @template V
 */

Expected behavior:
No crashes :)

Actual behavior:
Crash with:

[Error  - 8:36:05 AM] 'quickinfo' request failed with error.
Error processing request. Debug Failure. Did not expect SourceFile to have an Identifier in its trivia
Error: Debug Failure. Did not expect SourceFile to have an Identifier in its trivia
    at addSyntheticNodes (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:110456:30)
    at createSyntaxList (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:110472:13)
    at processNodes (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:110435:27)
    at visitNodes (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:15141:24)
    at Object.forEachChild (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:15371:24)
    at SourceFileObject.NodeObject.forEachChild (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:110412:23)
    at createChildren (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:110444:14)
    at SourceFileObject.NodeObject.getChildren (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:110389:56)
    at getTokenAtPositionWorker (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:88816:43)
    at getTouchingToken (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:88803:16)
    at Object.getTouchingPropertyName (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:88795:16)
    at getQuickInfoAtPosition (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:111443:27)
    at Object.getQuickInfoAtPosition (/Users/rasmus/.vscode/extensions/jpoissonnier.vscode-styled-components-0.0.21/node_modules/typescript-template-language-service-decorator/lib/template-language-service-decorator.js:71:24)
    at IOSession.Session.getQuickInfoWorker (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118918:62)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:118041:61)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119496:88
    at IOSession.Session.executeWithRequestId (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119487:28)
    at IOSession.Session.executeCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119496:33)
    at IOSession.Session.onMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:119516:35)
    at Interface.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:120770:27)
    at emitOne (events.js:116:13)
    at Interface.emit (events.js:211:7)
    at Interface._onLine (readline.js:282:10)
    at Interface._normalWrite (readline.js:424:12)
    at Socket.ondata (readline.js:141:10)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)

Playground Link: N/A

Related Issues: #22924

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Aug 24, 2018
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.1 milestone Aug 24, 2018
@ghost
Copy link

ghost commented Aug 27, 2018

Reproduced in typescript@3.0.1 (by hovering over K), did not reproduce in typescript@next.
Probably fixed by #26283.

@ghost ghost added the Fixed A PR has been merged for this issue label Aug 27, 2018
@ghost ghost closed this as completed Aug 27, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants