Hi everyone, I’m currently updating my project from ionic 7 to ionic 8, capacitor 5 to capacitor 6 and along with that I thought I’d also update to use Vite instead of the vue-cli. I’ve almost got it working except that now when I run vue-tsc && vite build
I get the following error even though it was working before:
Property '$router' does not exist on type 'CreateComponentPublicInstanceWithMixins<ToResolvedProps<{}, {}>, {}, {}, {}, { home(): Promise<void>; }, ComponentOptionsMixin, ComponentOptionsMixin, ... 18 more ..., {}>'.
await this.$router.replace({ path: '/home' }) //does not like this.$router
// src/router/index.ts
import { createRouter, createWebHistory } from '@ionic/vue-router'
const routes: Array<RouteRecordRaw> = [] // routes omitted for brevity
const router = createRouter({
history: createWebHistory(import.meta.env.VITE_BASE_URL),
routes
})
export default router
Anyone have an idea of what I might’ve missed while updating?
I also created a new Ionic project and copied over the vite.config.ts, tsconfig.json, and tsconfig.node.json