Type error when installing as global plugin
Closed this issue · 2 comments
hartmannj commented
I am not able to register the Observer globally because of below type error. I am using mobx-vue-lite 0.4.1
and vue 3.4.15
.
Following code
// main.js
import { createApp } from 'vue'
import Observer from 'mobx-vue-lite'
const app = createApp(App)
app.use(Observer)
throws a type error:
Argument of type
DefineComponent<{}, {}, { key: number; dispose: () => void; }, {}, { forceUpdate(): void; }, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & ... 1 more ... & ComponentCustomProps, Readonly<...>, {}, {}>
is not assignable to parameter of type Plugin<[]>
Type
DefineComponent<{}, {}, { key: number; dispose: () => void; }, {}, { forceUpdate(): void; }, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & ... 1 more ... & ComponentCustomProps, Readonly<...>, {}, {}>
is not assignable to type FunctionPlugin<[]>
Any idea what the problem is?
wobsoriano commented
hartmannj commented
Thanks for the quick answer. Just realised Webstorm was actually auto importing as following
import { Observer } from 'mobx-vue-lite'
which throws this error. Using Observer as default import works.