You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the list of imports provided by getSourceFile, ultimately used by getReferencedFiles, includes a tslib import, which seems reasonable.
However, the parent of the importName is Program itself, which does not have a parent. getSymbolAtLocation on the tslib import will, internally, call isExternalModuleImportEqualsDeclaration on the node.parent.parent, which doesn't exist, leading to a crash.
This prevents IntelliSense in VS Code from working at all.
A local hack that, because it was easy, I have implemented is wrapping the checker.getSymbolAtLocation call in Project.prototype.getReferencedFiles in a try/catch block that rethrows the exception unless importName.text === 'tslib'. This restores IntelliSense to working condition.
Including any tslib helper (by way of importHelpers) is enough to cause the crash.
asyncfunctionx(){}
The text was updated successfully, but these errors were encountered:
Jessidhia
changed the title
tsserver@2.1.1 crashes on isExternalModuleImportEqualsDeclaration when importHelpers is enabled
tsserver@2.1.1 crashes on the implicit tslib import when importHelpers is enabled
Nov 10, 2016
It looks like the list of imports provided by
getSourceFile
, ultimately used bygetReferencedFiles
, includes atslib
import, which seems reasonable.However, the
parent
of theimportName
is Program itself, which does not have aparent
.getSymbolAtLocation
on thetslib
import will, internally, callisExternalModuleImportEqualsDeclaration
on thenode.parent.parent
, which doesn't exist, leading to a crash.This prevents IntelliSense in VS Code from working at all.
A local hack that, because it was easy, I have implemented is wrapping the
checker.getSymbolAtLocation
call inProject.prototype.getReferencedFiles
in a try/catch block that rethrows the exception unlessimportName.text === 'tslib'
. This restores IntelliSense to working condition.Including any
tslib
helper (by way ofimportHelpers
) is enough to cause the crash.The text was updated successfully, but these errors were encountered: