TypeScript: Debug Failure. Did not expect JsxExpression to have an Identifier in its trivia
TypeScript Version: 2.9.2 Can’t use ts@next because of #25484 that happens every 5min
Search Terms:
Code
Error: Debug Failure. Did not expect JsxExpression to have an Identifier in its trivia
at addSyntheticNodes (/usr/local/lib/node_modules/typescript/lib/tsserver.js:89462:30)
at createChildren (/usr/local/lib/node_modules/typescript/lib/tsserver.js:89451:9)
at NodeObject.getChildren (/usr/local/lib/node_modules/typescript/lib/tsserver.js:89400:56)
at getTokenAtPositionWorker (/usr/local/lib/node_modules/typescript/lib/tsserver.js:71215:43)
at Object.getTokenAtPosition (/usr/local/lib/node_modules/typescript/lib/tsserver.js:71206:16)
at getInfo (/usr/local/lib/node_modules/typescript/lib/tsserver.js:85133:28)
at Object.getCodeActions (/usr/local/lib/node_modules/typescript/lib/tsserver.js:85095:28)
at /usr/local/lib/node_modules/typescript/lib/tsserver.js:83738:121
at Object.flatMap (/usr/local/lib/node_modules/typescript/lib/tsserver.js:1802:25)
at Object.getFixes (/usr/local/lib/node_modules/typescript/lib/tsserver.js:83738:23)
at /usr/local/lib/node_modules/typescript/lib/tsserver.js:90750:35
at Object.flatMap (/usr/local/lib/node_modules/typescript/lib/tsserver.js:1802:25)
at Object.getCodeFixesAtPosition (/usr/local/lib/node_modules/typescript/lib/tsserver.js:90748:23)
at IOSession.Session.getCodeFixes (/usr/local/lib/node_modules/typescript/lib/tsserver.js:97423:64)
at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/usr/local/lib/node_modules/typescript/lib/tsserver.js:96250:61)
at /usr/local/lib/node_modules/typescript/lib/tsserver.js:97580:88
at IOSession.Session.executeWithRequestId (/usr/local/lib/node_modules/typescript/lib/tsserver.js:97571:28)
at IOSession.Session.executeCommand (/usr/local/lib/node_modules/typescript/lib/tsserver.js:97580:33)
at IOSession.Session.onMessage (/usr/local/lib/node_modules/typescript/lib/tsserver.js:97600:35)
at Interface.<anonymous> (/usr/local/lib/node_modules/typescript/lib/tsserver.js:98831:27)
at emitOne (events.js:96:13)
at Interface.emit (events.js:191:7)
at Interface._onLine (readline.js:241:10)
at Interface._normalWrite (readline.js:384:12)
at Socket.ondata (readline.js:101:10)
at emitOne (events.js:96:13)
at Socket.emit (events.js:191:7)
at readableAddChunk (_stream_readable.js:178:18)
at Socket.Readable.push (_stream_readable.js:136:10)
at Pipe.onread (net.js:560:20)
Expected behavior:
Actual behavior:
Playground Link:
Related Issues:
tsserver logs id: 1660483066
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 4
- Comments: 27 (10 by maintainers)
TS 3.6.2 hinted at spread operators causing issues. So I did some code changes and found that changing the structure fixed the issue even in TS 3.5.2.
My issue appears to be fixed. I just wanted to leave this here for future reference. Thanks.
Here’s a simple repo that I see using that ts version:
|:xso that the code becomes:this happens consistently when doing TSX, like this (in order):
then try to do some conditionals using
{and}in a weird way, like type the element then put it inside {} like:then try to do the ternary expression
the error should pop up. the provider will fail forever to properly parse JSX unless you restart it. it happens so often and I’m currently on:
Echoing in that I am also receiving this. It’s on a private project, so sharing the code is not possible.
This ts error is in combination with syntax highlighting errors, which leads me to believe that there are experimental language features we’re using which
create-react-appcan transpile perfectly, but vscode’s typescript chokes on.by the way,
yarn tsccompiles without error in this project of mine which is showing theJsxExpressionerror