Home > Software engineering >  TypeError: createElement is not a function
TypeError: createElement is not a function

Time:10-13

HOW TO FIX THIS. as I understand it, so far vue-chart.js doesn't work well with Vue 3, but it's still interesting how to do it. This is not the first time I have already addressed this topic.

BaseChart.js?8ea9:7 Uncaught (in promise) TypeError: createElement is not a function
at Proxy.render (BaseChart.js?8ea9:7)
at renderComponentRoot (runtime-core.esm-bundler.js?5c40:427)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js?5c40:4194)
at ReactiveEffect.run (reactivity.esm-bundler.js?a1e9:160)
at setupRenderEffect (runtime-core.esm-bundler.js?5c40:4320)
at mountComponent (runtime-core.esm-bundler.js?5c40:4103)
at processComponent (runtime-core.esm-bundler.js?5c40:4061)
at patch (runtime-core.esm-bundler.js?5c40:3656)
at mountChildren (runtime-core.esm-bundler.js?5c40:3852)
at mountElement (runtime-core.esm-bundler.js?5c40:3761)

CodePudding user response:

You are using current version of vue-chart.js (2.x) with Vue 3.

vue-chart.js 2.x is for Vue 2 ONLY and there is no version for Vue 3 yet

Either use Vue 2 or switch to different Vue wrapper for chart.js which has support for Vue 3

  • Related