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 when adding a /** @type {} */ annotation to Salsa file #27471

Closed
Jessidhia opened this issue Oct 1, 2018 · 3 comments
Closed
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@Jessidhia
Copy link

Jessidhia commented Oct 1, 2018

TypeScript Version: 3.1.1

Search Terms:
getOutliningSpans tryReuseStructureFromOldProgram

Code

/** @type {} */
const foo = {}

The crash happens as soon as the { for the @type annotation is written, and from there on all live editing processing on the file stops and a TS service restart is necessary. The @type is underlined with a "Type expected" error.

Expected behavior:
JS editing to work smoothly

Actual behavior:

Error processing request. Debug Failure. False expression.
Error: Debug Failure. False expression.
    at tryReuseStructureFromOldProgram (.../node_modules/typescript/lib/tsserver.js:84795:22)
    at Object.createProgram (.../node_modules/typescript/lib/tsserver.js:84488:34)
    at synchronizeHostData (.../node_modules/typescript/lib/tsserver.js:114665:26)
    at Object.getProgram (.../node_modules/typescript/lib/tsserver.js:114748:13)
    at StandardScriptSourceHelper.getAllNodes (.../node_modules/typescript-template-language-service-decorator/lib/standard-script-source-helper.js:16:38)
    at StandardTemplateSourceHelper.getAllTemplates (.../node_modules/typescript-template-language-service-decorator/lib/standard-template-source-helper.js:149:43)
    at Object.getOutliningSpans (.../node_modules/typescript-template-language-service-decorator/lib/template-language-service-decorator.js:201:54)
    at IOSession.Session.getOutliningSpans (.../node_modules/typescript/lib/tsserver.js:122432:45)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (.../node_modules/typescript/lib/tsserver.js:121603:61)
    at .../node_modules/typescript/lib/tsserver.js:123061:88
    at IOSession.Session.executeWithRequestId (.../node_modules/typescript/lib/tsserver.js:123052:28)
    at IOSession.Session.executeCommand (.../node_modules/typescript/lib/tsserver.js:123061:33)
    at IOSession.Session.onMessage (.../node_modules/typescript/lib/tsserver.js:123081:35)
    at Interface.<anonymous> (.../node_modules/typescript/lib/tsserver.js:124344: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)

After the crash, only a restart revives the tsserver.

@ghost
Copy link

ghost commented Oct 1, 2018

Might have something to do with #27343, should wait on that to investigate.

@sandersn
Copy link
Member

This doesn't repro in master and does in 3.1. I think #27343 fixed it.

@sandersn sandersn added the Fixed A PR has been merged for this issue label Oct 18, 2018
@sandersn sandersn assigned ghost Oct 18, 2018
@mjbvz
Copy link
Contributor

mjbvz commented Oct 19, 2018

@RyanCavanaugh Can we please backport this fix to TS 3.1.4 too. We're seeing a reports of this in VS Code and it's pretty bad when it happens

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

5 participants