Skip to content
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: patch tsc to not crash on composite project errors #3176

Closed
wants to merge 1 commit into from

Conversation

sodatea
Copy link
Member

@sodatea sodatea commented May 12, 2023

Fixes #2622

I don't know the exact detail of the crash, but I find that tsc crashed because the diagnostic.file object is somehow missing a resolvedPath field. Meanwhile, the fileName field is always present. So I just added a fallback to fileName in the patch.

Maybe related: microsoft/TypeScript#54057

I only add it to the 5.0 branch because I haven't tested it on 4.x, so let's play it safe.

Fixes vuejs#2622

I don't know the exact detail of the crash, but I find that tsc crashed
because the `diagnostic.file` object is somehow missing a `resolvedPath`
field. Meanwhile, the `fileName` field is always present. So I just
added a fallback to `fileName` in the patch.

Maybe related: microsoft/TypeScript#54057

I only add it to the 5.0 branch because I haven't tested it on 4.x,
so let's play it safe.
sodatea added a commit to vuejs/create-vue that referenced this pull request May 12, 2023
Fixes #267

Thanks @segevfiner for noticing this new feature!

Currently there's still a small annoyance that `vue-tsc` would output
an extra error message when there're type errors in `.vue` files
vuejs/language-tools#2622 But it works well
if there's no error.

I've already submitted a PR to address it vuejs/language-tools#3176
@johnsoncodehk
Copy link
Member

Thanks for the PR, we avoided it from the source (@volar/typescript): volarjs/volar.js@c8cd804

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Throw an error when composite is enabled
2 participants