vuejs / vue-cli

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

vue-cli-service serve doesn't see changes in ts-files #6986

Open tonn opened 2 years ago

tonn commented 2 years ago

Version

4.5.15

Reproduction link

github.com

Environment info

Environment Info:

  System:
    OS: Windows 10 10.0.19043
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz   
  Binaries:
    Node: 16.13.2 - C:\nvm-node-current\node.EXE
    Yarn: 1.22.17 - C:\nvm-node-current\yarn.CMD
    npm: 8.4.0 - C:\nvm-node-current\npm.CMD
  Browsers:
    Chrome: 98.0.4758.82
    Edge: Spartan (44.19041.1266.0), Chromium (98.0.1108.43) 
  npmPackages:
    @fortawesome/vue-fontawesome: ^3.0.0-5 => 3.0.0-5        
    @growthbunker/vueflags: ^0.1.14 => 0.1.14 
    @headlessui/vue: ^1.4.3 => 1.4.3 
    @heroicons/vue: ^1.0.5 => 1.0.5 
    @intlify/vue-devtools:  9.1.9 
    @overcoder/vue-context-menu: ^0.1.3 => 0.1.3 
    @sentry/vue: ^6.17.6 => 6.17.6 
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1 
    @vue/babel-helper-vue-transform-on:  1.0.2 
    @vue/babel-plugin-jsx:  1.1.1 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  4.5.15 
    @vue/babel-preset-jsx:  1.2.4 
    @vue/babel-sugar-composition-api-inject-h:  1.2.1        
    @vue/babel-sugar-composition-api-render-instance:  1.2.4 
    @vue/babel-sugar-functional-vue:  1.2.2 
    @vue/babel-sugar-inject-h:  1.2.2 
    @vue/babel-sugar-v-model:  1.2.3 
    @vue/babel-sugar-v-on:  1.2.3 
    @vue/cli-overlay:  4.5.15 (3.12.1)
    @vue/cli-plugin-babel: ~4.5.15 => 4.5.15 
    @vue/cli-plugin-eslint: ~4.5.15 => 4.5.15 
    @vue/cli-plugin-router: ~4.5.15 => 4.5.15 
    @vue/cli-plugin-typescript: ~4.5.15 => 4.5.15 
    @vue/cli-plugin-vuex:  4.5.15 
    @vue/cli-service: ~4.5.15 => 4.5.15 (3.12.1)
    @vue/cli-shared-utils:  4.5.15 (3.12.1)
    @vue/compiler-core:  3.2.30 
    @vue/compiler-dom:  3.2.30
    @vue/compiler-sfc: ^3.2.30 => 3.2.30
    @vue/compiler-ssr:  3.2.30
    @vue/component-compiler-utils:  3.3.0
    @vue/devtools-api:  6.0.0-beta.20.1
    @vue/eslint-config-prettier: ^7.0.0 => 7.0.0
    @vue/eslint-config-typescript: ^10.0.0 => 10.0.0
    @vue/preload-webpack-plugin:  1.1.2
    @vue/reactivity:  3.2.30
    @vue/reactivity-transform:  3.2.30
    @vue/runtime-core:  3.2.30
    @vue/runtime-dom:  3.2.30
    @vue/server-renderer:  3.2.30
    @vue/shared:  3.2.30
    @vue/web-component-wrapper:  1.3.0
    ag-grid-vue3: ^27.0.0 => 27.0.0
    eslint-plugin-vue: ^7.19.1 => 7.20.0
    typescript: ~4.5.5 => 4.5.5
    vue: ^3.2.30 => 3.2.30 (2.6.14)
    vue-awesome-example:  2.0.0
    vue-class-component: ^8.0.0-rc.1 => 8.0.0-rc.1
    vue-dom-hints: ^1.2.0 => 1.2.0
    vue-emotion: 0.4.29 => 0.4.29
    vue-eslint-parser:  7.11.0 (8.1.0)
    vue-hot-reload-api:  2.3.4
    vue-i18n: ^9.1.9 => 9.1.9
    vue-loader:  15.9.8 (16.8.3)
    vue-property-decorator: ^10.0.0-rc.3 => 10.0.0-rc.3
    vue-router: ^4.0.12 => 4.0.12
    vue-spinner: ^1.0.4 => 1.0.4
    vue-style-loader:  4.1.3
    vue-tailwind: ^2.5.0 => 2.5.0
    vue-template-es2015-compiler:  1.9.1
    vue3-treeselect: ^0.1.10 => 0.1.10
    vuex: ^4.0.2 => 4.0.2
    vuex-class: ^0.3.2 => 0.3.2
    vuex-persist: ^3.1.3 => 3.1.3
    vuexok: ^1.0.2 => 1.0.2
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Run vue-cli-service serve You will get error

ERROR in src/components/HelloWorld.vue:136:22
TS2339: Property 'field1' does not exist on type 'ITest'.
    134 |
    135 |   get fun() {
  > 136 |     return this.obj?.field1;
        |                      ^^^^^^
    137 |   }
    138 | }
    139 | </script>

Uncomment this field in /src/components/test.ts And save file.

What is expected?

Project should be recompiled with no errors

What is actually happening?

Nothing - serve ignores changes in test.ts file


Solved only by serve restarting

tonn commented 2 years ago

I understand that it's too late to fix it in the 4 version. But maybe someone knows workaround?