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

vue-tsc ignores type errors in .vue files if the incremental setting is true #2756

Closed
lozinsky opened this issue Apr 28, 2023 · 1 comment · Fixed by #3218
Closed

vue-tsc ignores type errors in .vue files if the incremental setting is true #2756

lozinsky opened this issue Apr 28, 2023 · 1 comment · Fixed by #3218
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@lozinsky
Copy link

Describe the bug
vue-tsc ignores type errors in .vue files if the incremental setting is true and tsconfig.tsbuildinfo exists from a previous type check.

To Reproduce
Steps to reproduce the behavior:

  1. Add "incremental": true setting to tsconfig.json
  2. Run npx vue-tsc --noEmit
  3. Add type error to any *.vue file
  4. Run npx vue-tsc --noEmit

Expected behavior
There should be an error.

Code snippets
https://github.com/lozinsky/vue-tsc-with-incremental

@lucasavila00
Copy link
Contributor

lucasavila00 commented May 23, 2023

It seems adding

    if (semver.gt(tsPkg.version, "5.0.4")) {
      tryReplace(
        `return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);`,
        `buildInfo.program.fileNames = buildInfo.program.fileNames.map(file => file.replace(/\.vue\.(j|t)sx?$/i, '.vue'));
        return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);`
      );
    }

to the vue-tsc patch

// patches logic for checking root file extension in build program for incremental builds
fixes that

@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants