Closed saibbyweb closed 8 months ago
Great thanks. If I make this change in the npm module will it still work?
On Mon, May 10, 2021, 10:29 PM saibbyweb @.***> wrote:
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. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <https://github.com/robinrodricks/vue3-touch-events/issues/2>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABT3UKUZ425LCYBHUE3YRITTNAGFRANCNFSM44RWFJZA> .
That you'll have to test yourself. Best of luck.
I have the same problem :|
I've raised https://github.com/robinrodricks/vue3-touch-events/pull/28 to fix this.
In the meantime, the more "accurate" workaround is:
declare module "vue" {
export {Plugin as PluginObject} from 'vue';
}
I am using Vue3 + Typescript (Vite), initialising the plugin in
main.ts
like this:Everything works fine in dev, but my builds are failing. I'm getting:
Temporarily, I'm able to fix this by adding a file at
src/types/vue3-touch-events.d.ts
with the following contents:Hope it helps.