vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

misreport when compiling #5020

Open bruceauyeung opened 4 years ago

bruceauyeung commented 4 years ago

Version

3.12.1

Reproduction link

http://no.reproduction.repo

Environment info


  System:
    OS: Linux 3.10 CentOS Linux 7 (Core)
    CPU: (8) x64 Embedded AMD Opteron(tm) Processor 23KS EE
  Binaries:
    Node: 12.13.1 - /bin/node
    Yarn: 1.19.0 - /bin/yarn
    npm: 6.12.1 - /bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 69.0.1
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.1.2
    @vue/babel-preset-app:  4.0.5
    @vue/babel-preset-jsx:  1.1.2
    @vue/babel-sugar-functional-vue:  1.1.2
    @vue/babel-sugar-inject-h:  1.1.2
    @vue/babel-sugar-v-model:  1.1.2
    @vue/babel-sugar-v-on:  1.1.2
    @vue/cli-overlay:  4.0.5
    @vue/cli-plugin-babel: ^4.0.0 => 4.0.5
    @vue/cli-plugin-e2e-cypress: ^4.0.0 => 4.0.5
    @vue/cli-plugin-eslint: ^4.0.0 => 4.0.5
    @vue/cli-plugin-router:  4.0.5
    @vue/cli-plugin-typescript: ^4.0.0 => 4.0.5
    @vue/cli-plugin-unit-jest: ^4.0.0 => 4.0.5
    @vue/cli-plugin-vuex:  4.0.5
    @vue/cli-service: ^4.0.0 => 4.0.5
    @vue/cli-shared-utils:  4.0.5
    @vue/component-compiler-utils:  3.0.2
    @vue/eslint-config-prettier: ^5.0.0 => 5.1.0
    @vue/eslint-config-typescript: ^4.0.0 => 4.0.0
    @vue/preload-webpack-plugin:  1.1.1
    @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29
    @vue/web-component-wrapper:  1.2.0
    babel-helper-vue-jsx-merge-props:  2.0.3
    eslint-plugin-vue: ^5.0.0 => 5.2.3
    jest-serializer-vue:  2.0.2
    typescript: ~3.5.3 => 3.5.3
    vue: ^2.6.10 => 2.6.10
    vue-class-component: ^7.0.2 => 7.1.0
    vue-cli-plugin-electron-builder: ^1.4.3 => 1.4.3
    vue-eslint-parser:  5.0.0
    vue-hot-reload-api:  2.3.4
    vue-jest:  3.0.5
    vue-loader:  15.7.2
    vue-property-decorator: ^8.3.0 => 8.3.0
    vue-router: ^3.1.3 => 3.1.3
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
    vuex: ^3.0.1 => 3.1.2
  npmGlobalPackages:
    @vue/cli: 3.3.0

Steps to reproduce

Starting development server... Starting type checking service... Using 1 worker with 2048MB memory limit 98% after emitting CopyPlugin

ERROR Failed to compile with 1 errors 10:23:29

error in ./src/commons/node/netExtra.ts

Module Error (from D:/Home/icenter-next/node_modules/eslint-loader/index.js): error: 'NetExtra' is already defined (no-redeclare) at src\commons\node\netExtra.ts:26:18: 24 | } 25 |

26 | export namespace NetExtra { | ^ 27 | export enum IPAddressFamily { 28 | IPV4 = 'IPv4', 29 | IPV6 = 'IPv6',

1 error found.

@ ./src/bindings/ussdk/index.ts 11:0-51 124:20-28 124:41-49 @ ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/ts-loader??ref--14-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/HelloWorld.vue?vue&type=script&lang=ts& @ ./src/components/HelloWorld.vue?vue&type=script&lang=ts& @ ./src/components/HelloWorld.vue @ ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/ts-loader??ref--14-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/App.vue?vue&type=script&lang=ts& @ ./src/App.vue?vue&type=script&lang=ts& @ ./src/App.vue @ ./src/main.ts @ multi (webpack)-dev-server/client?http://10.4.205.47:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts

No type errors found Version: typescript 3.5.3 Time: 20043ms

the very last 3 lines : No type errors found, but actually eslint-loader reports: 'NetExtra' is already defined (no-redeclare) at src\commons\node\netExtra.ts:26:18:

this situation may mislead developers , especially there are lots of warnings.

if this is because different tools report them, can we have a summary report ?

What is expected?

if any stage of building failed, the final report will report failure

What is actually happening?

the final report says No type errors found when eslint-loader reporting an error

LinusBorg commented 4 years ago

"no type errors" refers to errors with typescript types, not lint errors or warnings from eslint.

So the error message is technically correct: typescript found no type errors. Your build failed because of a linter error.

But I agree that the diference is subtle and might be missed.

I'm not sure if and how we can change this output from fork-ts-checker-webpack-plugin, though ...