lucpotage/vue-katex

TypeError: undefined is not an Object (evaluation 'r2.prototype.$katexOptions = a2')

3urdparty opened this issue · 1 comments

Error trying to install VueKatex plugin due to possible changes in Vue3. I am facing this error only when I try to install the Vue-Katex plugin:

import 'katex/dist/katex.min.css'
import VueKatex from 'vue-katex'

const app = createApp(App)
app.use(VueKatex, {
  globalOptions: {}
})
image

This is possibly due to the migration to Vue3 according to this [reddit post]:(https://www.reddit.com/r/vuejs/comments/j99qgn/help_vue_js_3_cannot_read_property_prototype_of/)

// Before 
Vue.prototype.$http = () => {}

// After 
const app = Vue.createApp({})
app.config.globalProperties.$http = () => {}

Ps. This is my first issue so please guide me on how to author these for future reference. Apologies if I break any unspoken rules 🙏🏽

Never mind, I just realized that the plugin is a Vue2 plugin and resorted to @hsorby 's Vue3 alternative instead