Skip to content

Auto-import won't import default exports more than once. #44688

Closed
@KodyJKing

Description

@KodyJKing

Bug Report

After auto-importing a default export once, I have to restart the language server to auto-import a default export again.

🔎 Search Terms

Typescript VSCode auto-import default exports not working

🕗 Version & Regression Information

I can reproduce this with 4.3.0-beta through 4.4.0-dev.20210621. It works normally for me with 4.2.4 and lower.

I tested this in two environments, Windows 7 with NodeJs v14.15.4 and Windows 10 with NodeJs v14.17.1. I was using VSCode v1.57.1 for both.

💻 Code

// import Bar from "./Bar"
// import Foo from "./Foo"

class Baz {
    foo: Foo // Auto-importing this will work.
    bar: Bar // Then auto-importing this will fail.
}

Here is a repository that demonstrates the issue.

Metadata

Metadata

Assignees

Labels

Needs More InfoThe issue still hasn't been fully clarified

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions