Vue 2.7.14 ... migration from Webpack to Vitejs, extend Vue #81
Unanswered
SaschaAusUlm
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
We're trying to convert our application (Vue.js 2.7.14) to Vitejs as preparation for a Vue 3 migration later this summer.
So I migrated and "vite build" works fine.
But when I run the application, I encounter the error that our logging mechanism no longer works.
We do a:
`
declare module 'vue/types/vue' {
export interface Vue {
$log: CubeLogger;
}
}
declare module 'vue/types/options' {
export interface ComponentOptions {
log?: CubeLogger;
}
}
`
with CubeLogger being our specialized logging component. In our main.ts we're then assigning an instance of our logger,
so that "$log" exists on "this". Works with Webpack.
But using Vitejs, "this.$log" is undefined and I am not getting far.
Asked on the Vitejs forum here: vitejs/vite#12508
They said probably an issue with vite-plugin-vue2. Is that scenario supported with the vite-plugin-vue2?
If so, then I will submit a test case, no big deal. Just wanted to ask before. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions