Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MetRonnie opened this issue Jun 27, 2023 · 1 comment

Comments

@MetRonnie
Copy link

MetRonnie commented Jun 27, 2023

<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
Copy link
Contributor

IlCallo commented Aug 5, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants