Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Vue.use TS error No overload matches this call #32

Open
fairking opened this issue Aug 1, 2020 · 0 comments
Open

Vue.use TS error No overload matches this call #32

fairking opened this issue Aug 1, 2020 · 0 comments

Comments

@fairking
Copy link

fairking commented Aug 1, 2020

I cannot setup the movue package. Bellow is my code:
package.json:

"movue": "0.3.2",
"mobx": "5.15.4"

tsconfig.json:

{
	"compileOnSave": false,
	"compilerOptions": {
		"target": "es5",
		"module": "esnext",
		"strict": true,
		"strictNullChecks": false,
		"noImplicitAny": false,
		"noImplicitThis": false,
		"removeComments": false,
		"allowUnreachableCode": false,
		"allowUnusedLabels": false,
		"importHelpers": true,
		"moduleResolution": "node",
		"experimentalDecorators": false,
		"esModuleInterop": true,
		"allowSyntheticDefaultImports": true,
		"sourceMap": false,
		"allowJs": false,
		"baseUrl": ".",
		"types": [ "webpack-env", "jest" ],
		"paths": {
			"@/*": [ "src/*" ]
		},
		"lib": [ "es5", "esnext", "dom", "dom.iterable", "scripthost" ],
		"outDir": "dist"
	},
	"include": [ "src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx" ],
	"files": [ "src/shims-vue.d.ts" ],
	"exclude": [ "node_modules" ]
}

main.ts:

import Vue from "vue";

import Movue from 'movue';
import { reaction } from 'mobx';

Vue.use(Movue, { reaction });

Screenshot:
image

Error:

192:9 No overload matches this call.
  Overload 1 of 2, '(plugin: PluginObject<IMobxMethods> | PluginFunction<IMobxMethods>, options?: IMobxMethods): VueConstructor<...>', gave the following error.
    Argument of type '{ install: (Vue: typeof Vue, mobxMethods: IMobxMethods) => void; }' is not assignable to parameter of type 'PluginObject<IMobxMethods> | PluginFunction<IMobxMethods>'.
      Type '{ install: (Vue: typeof Vue, mobxMethods: IMobxMethods) => void; }' is not assignable to type 'PluginObject<IMobxMethods>'.
        Types of property 'install' are incompatible.
          Type '(Vue: typeof Vue, mobxMethods: IMobxMethods) => void' is not assignable to type 'PluginFunction<IMobxMethods>'.
            Types of parameters 'Vue' and 'Vue' are incompatible.
              Type 'VueConstructor<Vue>' is not assignable to type 'typeof Vue'.
                The types of 'config.errorHandler' are incompatible between these types.
                  Type '(err: Error, vm: import("C:/Code/Maximus/src/Maximus.App/node_modules/vue/types/vue").Vue, info: string) => void' is not assignable to type '(err: Error, vm: import("C:/Code/Maximus/src/Maximus.App/node_modules/movue/node_modules/vue/types/vue").Vue, info: string) => void'.
                    Types of parameters 'vm' and 'vm' are incompatible.
                      Type 'Vue' is missing the following properties from type 'Vue': $i18n, $t, $tc, $te, and 6 more.
  Overload 2 of 2, '(plugin: PluginObject<any> | PluginFunction<any>, ...options: any[]): VueConstructor<Vue>', gave the following error.
    Argument of type '{ install: (Vue: typeof Vue, mobxMethods: IMobxMethods) => void; }' is not assignable to parameter of type 'PluginObject<any> | PluginFunction<any>'.
      Type '{ install: (Vue: typeof Vue, mobxMethods: IMobxMethods) => void; }' is not assignable to type 'PluginObject<any>'.
        Types of property 'install' are incompatible.
          Type '(Vue: typeof Vue, mobxMethods: IMobxMethods) => void' is not assignable to type 'PluginFunction<any>'.
            Types of parameters 'Vue' and 'Vue' are incompatible.
              Type 'VueConstructor<Vue>' is not assignable to type 'typeof Vue'.

Anyone knows what is the problem?

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

No branches or pull requests

1 participant