My stack is Nuxtjs and Nuxt-property-decorator
I made a mixin to avoid duplicating methods
This method requires a component (alert component)
So, I imported the component in the mixin
ButI got an error when importing the component
Note: I am sure the import address is real
mixin/logOut.ts from 'vue' import Vue
import { Component } from 'nuxt-property-decorator' import AppAlert from '~/components/Common/AppAlert' @Component export class LogOut extends Vue { async LogOut() { const confirm = await this.$dialog.show({ component: AppAlert, props: { title: { text: 'Exit ?', icon: 'exclamation-thick' }, body: 'Exit Connector ?', btn: { text: 'Confirm', icon: 'power', color: 'error' } } }) if (confirm) { this.$auth.logout() } } }
The error text is:
Cannot find module '~/components/Common/AppAlert' or its corresponding type declarations.ts(2307)
I found the answer from this link.
I added
vue-shims.d.ts