-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Fix crash on attempting to suggest a ts import for a synthetic js resolution #41467
Fix crash on attempting to suggest a ts import for a synthetic js resolution #41467
Conversation
src/compiler/checker.ts
Outdated
if (location.pos < 0 || location.end < 0) { | ||
// Psuedo-synthesized input node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (location.pos < 0 || location.end < 0) { | |
// Psuedo-synthesized input node | |
// Pseudo-synthesized input node | |
if (location.pos < 0 || location.end < 0) { |
@typescript-bot cherry-pick this into release-4.1 |
Heya @weswigham, I've started to run the task to cherry-pick this into |
Hey @weswigham, I couldn't open a PR with the cherry-pick. (You can check the log here). You may need to squash and pick this PR into release-4.1 manually. |
Port #41467 to `release-4.1`
Fixes #41410
After looking at it a bit, I realized we were checking if
ignoreErrors
was set, but were unconditionally making a diagnostic because we wanted to try and offer a suggestion (namely, a suggestion to try to install types for it when the js seems to be present, but not any types). I simply changed our suggestion-or-error adding function to more gracefully handle the psuedo-synthetic nodes we use for some compiler-option-added imports. Now that I know how it works, I can say it was theoretically possible to trigger the same issue withimportHelpers
, but you'd have needed to have atslib
on disk with no accompanying types, which is obviously not what we distribute (therefore very unlikely to occur).