Skip to content

Don’t try to create auto import provider when host program doesn’t exist #45126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 20, 2021

Conversation

andrewbranch
Copy link
Member

Fixes #44849

Looking at the error stack and the code path leading to the crash, I’m not sure how to produce this, but one user claimed that they had some reason to believe it was triggered by an unofficial Vue extension, and indeed both VS Code reports list that extension, but I couldn’t trigger it myself. At any rate, the auto import provider can be loaded lazily, and if someone somehow requests it before having a program, there’s no reason to crash; we can just return undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TS Server fatal error: Cannot read property 'getSourceFile' of undefined
3 participants