Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building newly generated Vue project: Unable to resolve signature of class decorator #3105

Closed
danielktaylor opened this issue Dec 10, 2018 · 4 comments

Comments

@danielktaylor
Copy link

Version

3.2.1

Reproduction link

https://github.com/danielktaylor/vue-bug-report

Environment info

Environment Info:

  System:
    OS: macOS 10.14.1
    CPU: (4) x64 Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
  Binaries:
    Node: 11.4.0 - ~/Downloads/bugreport/env/bin/node
    Yarn: Not Found
    npm: 6.4.1 - ~/Downloads/bugreport/env/bin/npm
  Browsers:
    Chrome: 70.0.3538.110
    Firefox: Not Found
    Safari: 12.0.1
  npmPackages:
    @vue/babel-preset-app:  3.2.0
    @vue/cli-overlay:  3.2.0
    @vue/cli-plugin-babel: ^3.2.0 => 3.2.0
    @vue/cli-plugin-typescript: ^3.2.0 => 3.2.0
    @vue/cli-service: ^3.2.0 => 3.2.0
    @vue/cli-shared-utils:  3.2.0
    @vue/component-compiler-utils:  2.3.0
    @vue/preload-webpack-plugin:  1.1.0
    @vue/web-component-wrapper:  1.2.0
    babel-helper-vue-jsx-merge-props:  2.0.3
    babel-plugin-transform-vue-jsx:  4.0.1
    vue: ^2.5.17 => 2.5.19
    vue-class-component: ^6.0.0 => 6.3.2
    vue-hot-reload-api:  2.3.1
    vue-loader:  15.4.2
    vue-property-decorator: ^7.0.0 => 7.2.0
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.5.17 => 2.5.19
    vue-template-es2015-compiler:  1.6.0
  npmGlobalPackages:
    @vue/cli: 3.2.1

Steps to reproduce

vue create my-project

~~ config settings ~~

{
  "useTaobaoRegistry": false,
  "presets": {
    "bug-report": {
      "useConfigFiles": true,
      "plugins": {
        "@vue/cli-plugin-babel": {},
        "@vue/cli-plugin-typescript": {
          "classComponent": true,
          "tsLint": true,
          "lintOn": [
            "save"
          ],
          "useTsWithBabel": true
        }
      },
      "cssPreprocessor": "sass"
    }
  }
}

What is expected?

Clean project build

What is actually happening?

Errors during project build


DONE  Compiled successfully in 3114ms                                                                      4:19:39 PM

ERROR in /Users/danieltaylor/Downloads/bugreport/my-project/src/components/HelloWorld.vue
36:1 Unable to resolve signature of class decorator when called as an expression.
  Type '<VC extends VueClass<Vue>>(target: VC) => VC' is missing the following properties from type 'typeof HelloWorld': extend, nextTick, set, delete, and 7 more.
    34 | import { Component, Prop, Vue } from 'vue-property-decorator';
    35 |
  > 36 | @Component
       | ^
    37 | export default class HelloWorld extends Vue {
    38 |   @Prop() private msg!: string;
    39 | }
No lint errors found
Version: typescript 3.2.2, tslint 5.11.0
Time: 3078ms
@Eacolt
Copy link

Eacolt commented Dec 10, 2018

I am the same problem ! I have the typescript 3.2.2 and @vue/cli the latest version, I have no idea, who can help me?

@pyt111
Copy link

pyt111 commented Dec 10, 2018

Me too.

@LinusBorg
Copy link
Member

This is a bug in vue-class-component, or rather an incompatiblity between this package and the types that Vue core provides.

The culprit is a change in Vue 2.5.18

Issue is tracked here: vuejs/vue-class-component#294
PR is already done here: vuejs/vue#9173

Until this PR has been merged and released, please downgrade to Vue 2.5.17

@yyx990803
Copy link
Member

Should be resolved in Vue core 2.5.20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants