Vue 2.7+ no longer fails on and report type errors in build and serve commands

This issue has been tracked since 2022-07-29.



Reproduction link

Steps to reproduce

Based from the vuejs-type-bug-demo root folder:

  • cd ./hello-world-2.6 && npm install && npm run build
  • cd ./hello-world-2.7 && npm install && npm run build

What is expected?

In 2.7 I expect the errors in typing to fail the build as it does in 2.6

What is actually happening?

Succeeding the build without any errors thrown

derat wrote this answer on 2022-08-17

I noticed this as well after upgrading a project from 2.6.14 to 2.7.8. Type errors seem to be silently ignored by both npm run serve and npm run build.

nieyuyao wrote this answer on 2022-08-19

This seems to be a compiler-sfc issue that causes the ForkTsCheckerWebpackPlugin to not get the correct script. This pr may solve the issue.

yyx990803 wrote this answer on 2022-08-19

This relies on ts-loader to fix its compatibility with Vue 2.7.

The latest recommendation, however, is to avoid doing type check as part of the webpack build, and instead using vue-tsc, which also works with Vue 2.7+. You can start it in a separate process in watch mode.

RuudV wrote this answer on 2022-09-02

Thanks for your reply. We will try that, but it would be nice if this got mentioned in the upgrade to vue 2.7+, so users can determine if they can spare the extra time invested to setup vue-tsc and disable type checking in webpack during serve and build commands.

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-10-03
Star Count 199758
Watcher Count 6095
Fork Count 32874
Issue Count 590


Issue Title Created Date Updated Date