vue icon indicating copy to clipboard operation
vue copied to clipboard

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

Open RuudV opened this issue 1 year ago • 4 comments

Version

2.7.8

Reproduction link

github.com

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

RuudV avatar Jul 29 '22 14:07 RuudV

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.

derat avatar Aug 15 '22 16:08 derat

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

nieyuyao avatar Aug 17 '22 07:08 nieyuyao

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.

yyx990803 avatar Aug 19 '22 03:08 yyx990803

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.

RuudV avatar Sep 02 '22 12:09 RuudV

I can confirm that this particular problem is fixed in 2.7.11

rossinek avatar Oct 13 '22 07:10 rossinek