Subscribe on changes!

Argument of type 'typeof import(“../dist/vue”)' is not assignable to parameter of type

avatar
Oct 15th 2020

Version

3.0.0

Reproduction link

http://null.com

image

Steps to reproduce

When I create a new Vue3.0 project to run, the terminal will warn main.ts

What is expected?

What I need to do to solve this error?

What is actually happening?

Error:(6, 11) TS2345: Argument of type 'typeof import("C:/Users/Admin/Desktop/vue3-zhihu/node_modules/vue/dist/vue")' is not assignable to parameter of type 'Component<any, any, any, Record<string, ComputedGetter | WritableComputedOptions>, MethodOptions>'. Type 'typeof import("C:/Users/Admin/Desktop/vue3-zhihu/node_modules/vue/dist/vue")' is not assignable to type 'ComponentOptions<any, any, any, Record<string, ComputedGetter | WritableComputedOptions>, MethodOptions, any, any, any>'. Type 'typeof import("C:/Users/Admin/Desktop/vue3-zhihu/node_modules/vue/dist/vue")' is not assignable to type 'ComponentOptionsBase<any, any, any, Record<string, ComputedGetter | WritableComputedOptions>, MethodOptions, ... 4 more ..., {}>'. Types of property 'computed' are incompatible. Type '{ (getter: ComputedGetter): ComputedRef; (options: WritableComputedOptions): WritableComputedRef; }' is not assignable to type 'Record<string, ComputedGetter | WritableComputedOptions>'. Index signature is missing in type '{ (getter: ComputedGetter): ComputedRef; (options: WritableComputedOptions): WritableComputedRef; }'.

avatar
Oct 15th 2020

We can't do anything with this report as there is no information about your setup or, as is required, a runnable reproduction.

Please provide those or the issue will be closed as it's not actionable.

avatar
Oct 15th 2020

I just created a new Vue3.0 project and ran it on WebStorm with this error

avatar
Oct 15th 2020

That's still very, very little information.

  • How did you create the project, Vue CLI? which version do the dependencies have? Can you just put the project on github for us to run?
  • How did you run it?
  • Is that a compilation error from Vue CLI after running npm run serve or an IDE error from in-Editor checks?
avatar
Oct 15th 2020

Please read https://new-issue.vuejs.org/?repo=vuejs/vue#why-repro and open a new issue if you manage to provide a boiled down reproduction. Note it can still be a repository on github created with vue-cli


Remember to use the forum or the Discord chat to ask questions!