[Chartjs]-Vue 3 chart js cause Cannot read properties of null (reading 'getContext')?

2👍

You should unwrap/unproxy this.chart before accessing it by using Vue3 "toRaw" function:

import { toRaw } from "vue";

...

  watch: {
    data: {
      handler() {
        toRaw(this.chart).destroy()
        this.renderChart()
      },

Leave a comment