vuejs / vue-cli

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

Cannot destructure property 'script' of 'parser.parseComponent(...)' as it is undefined. #5574

Closed CaiPeng1989 closed 4 years ago

CaiPeng1989 commented 4 years ago

Version

4.4.3

Environment info

  System:
    OS: Windows 10 10.0.19041
    CPU: (4) x64 Intel(R) Core(TM) i5-6300HQ CPU @ 2.30GHz
  Binaries:
    Node: 14.4.0 - C:\Program Files\nodejs\node.EXE       
    Yarn: 1.22.4 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 44.19041.1.0
  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.4.3 
    @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.4.3 
    @vue/cli-plugin-babel: ~4.4.3 => 4.4.3
    @vue/cli-plugin-eslint: ~4.4.3 => 4.4.3
    @vue/cli-plugin-router: ~4.4.3 => 4.4.3
    @vue/cli-plugin-typescript: ~4.4.3 => 4.4.3
    @vue/cli-plugin-vuex: ~4.4.3 => 4.4.3
    @vue/cli-service: ~4.4.3 => 4.4.3
    @vue/cli-shared-utils:  4.4.3
    @vue/compiler-core:  3.0.0-beta.14
    @vue/compiler-dom:  3.0.0-beta.14
    @vue/compiler-sfc: ^3.0.0-beta.14 => 3.0.0-beta.14
    @vue/compiler-ssr:  3.0.0-beta.14
    @vue/component-compiler-utils:  3.1.2
    @vue/eslint-config-standard: ^5.1.2 => 5.1.2
    @vue/eslint-config-typescript: ^5.0.2 => 5.0.2
    @vue/preload-webpack-plugin:  1.1.1
    @vue/reactivity:  3.0.0-beta.14
    @vue/runtime-core:  3.0.0-beta.14
    @vue/runtime-dom:  3.0.0-beta.14
    @vue/shared:  3.0.0-beta.14
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^7.0.0-alpha.6 => 7.0.0-alpha.6
    typescript: ~3.9.3 => 3.9.5
    vue: ^3.0.0-beta.14 => 3.0.0-beta.14
    vue-cli-plugin-vue-next: ~0.1.3 => 0.1.3
    vue-eslint-parser:  7.1.0
    vue-hot-reload-api:  2.3.4
    vue-loader:  16.0.0-beta.3 (15.9.2)
    vue-router: ^4.0.0-alpha.12 => 4.0.0-alpha.12
    vue-style-loader:  4.1.2
    vue-template-es2015-compiler:  1.9.1
    vuex: ^4.0.0-beta.2 => 4.0.0-beta.2
  npmGlobalPackages:
    @vue/cli: 4.4.3

Steps to reproduce

Create a Typescript project through @vue/cli, vue add vue-next upgrade cli dependency to @4.4.3, run serve.

What is expected?

No error

What is actually happening?

INTERNAL ERROR(undefined,undefined) Cannot destructure property 'script' of 'parser.parseComponent(...)' as it is undefined.
stack trace:
TypeError: Cannot destructure property 'script' of 'parser.parseComponent(...)' as it is undefined.
    at Function.resolveScriptBlock (D:\test\new-test\node_modules\fork-ts-checker-webpack-plugin\lib\VueProgram.js:196:17)
    at Object.host.getSourceFile (D:\test\new-test\node_modules\fork-ts-checker-webpack-plugin\lib\VueProgram.js:106:45)
    at findSourceFile (D:\test\new-test\node_modules\typescript\lib\typescript.js:101513:29)
    at processImportedModules (D:\test\new-test\node_modules\typescript\lib\typescript.js:101854:25)
    at findSourceFile (D:\test\new-test\node_modules\typescript\lib\typescript.js:101561:17)
    at D:\test\new-test\node_modules\typescript\lib\typescript.js:101390:85
    at getSourceFileFromReferenceWorker (D:\test\new-test\node_modules\typescript\lib\typescript.js:101357:34)
    at processSourceFile (D:\test\new-test\node_modules\typescript\lib\typescript.js:101390:13)
    at processRootFile (D:\test\new-test\node_modules\typescript\lib\typescript.js:101213:13)
    at D:\test\new-test\node_modules\typescript\lib\typescript.js:100137:60
Danielg212 commented 1 year ago

any update?

RobineSavert commented 1 year ago

Am having the same issue...