apexcharts / vue3-apexcharts

📊 Vue-3 component for ApexCharts
MIT License
306 stars 33 forks source link

Bogus TypeError when updating box plot series with a different number of data points #79

Open MetRonnie opened 1 year ago

MetRonnie commented 1 year ago
<VueApexCharts :series="series" type="boxPlot" />

When series changes I get a TypeError if the length of series[0].data has changed

apexcharts.common.js:14 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'resetSeries')
    at Proxy.value (apexcharts.common.js:14:41711)
    at Object.deep (vue3-apexcharts.common.js:465:23)
    at callWithErrorHandling (runtime-core.esm-bundler.js:173:22)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:182:21)
    at job (runtime-core.esm-bundler.js:1812:17)
    at flushPreFlushCbs (runtime-core.esm-bundler.js:336:13)
    at updateComponentPreRender (runtime-core.esm-bundler.js:5789:9)
    at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5702:21)
    at ReactiveEffect.run (reactivity.esm-bundler.js:190:25)
    at instance.update (runtime-core.esm-bundler.js:5763:56)

(that was Chrome; in Firefox the error message is TypeError: this.series is null)

apexcharts.common.js:

    }, {
        key: "updateSeries",
        value: function() {
            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []
              , e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]
              , i = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2];
            return this.series.resetSeries(!1), // <----------------

However if I catch the error like this:

<script>
export default {
  errorCaptured (err, instance, info) {
    if (err.message.includes('resetSeries')) {
      return false
    }
  },
  ...

Everything works just fine.

For some reason I can't reproduce this in Vue SFC Playground

Version


apexcharts: 3.41.0
vue3-apexcharts: 1.4.1
IlCallo commented 1 year ago

Hitting a similar problem when both series and type change one after the other I think the chart engine choke itself if it's still dealing with the previous change and a new update comes in

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

MetRonnie commented 1 month ago

Still present on

apexcharts: 3.51.0
vue3-apexcharts: 1.5.3