Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

tsserver@2.1.1 crashes on the implicit tslib import when importHelpers is enabled #12142

Copy link
Copy link
@Jessidhia

Description

@Jessidhia
Issue body actions

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.

async function x() {}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.