Skip to content

tsserver crash when adding a /** @type {} */ annotation to Salsa file #27471

Closed
@Jessidhia

Description

@Jessidhia

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.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions