Module '"vue"' has no exported member 'PluginObject' #2
Closed
Description
I am using Vue3 + Typescript (Vite), initialising the plugin in main.ts
like this:
import { createApp } from 'vue'
import App from "./App.vue"
import Vue3TouchEvents from "vue3-touch-events";
const app = createApp(App);
app.use(Vue3TouchEvents);
app.mount('#app');
Everything works fine in dev, but my builds are failing. I'm getting:
node_modules/vue3-touch-events/index.d.ts:1:9 - error TS2305:
Module '"vue"' has no exported member 'PluginObject'.
1 import {PluginObject} from "vue";
~~~~~~~~~~~~
Temporarily, I'm able to fix this by adding a file at src/types/vue3-touch-events.d.ts
with the following contents:
import Vue from "vue";
declare module "vue" {
export type PluginObject<T> = (app: Vue.App, ...options: any[]) => any;
}
Hope it helps.