question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The simplest custom watcher causes console errors [Vue warn] regarding infinite loop

See original GitHub issue

Expected Behavior

Calling this.renderChart(this.data, this.options) or this.$data._chart.update() should not bring about risk of and console error(s) regarding infinite loops:

[Vue warn]: You may have an infinite update loop in watcher with expression “data”

Actual Behavior

  1. Create a custom component importing, say, { Line } from 'vue-chartjs';;
  2. Create a button clicking upon which changes, say, labels for the chart data object.
  3. Realize that mixins.reactiveProp does not penetrate data object deeply enough to reach the labels property, which is usually the use-case, and that using it would require to change a prop name from :data to :chart-data of your already widely used component.
  4. Create a simple custom watcher instead, whether it be with this.renderChart(this.data, this.options) or this.$data._chart.update() callbacks to watch over data / chartData property, as per the docs.

On my end, doing so produces errors in the console, with that the this.renderChart(this.data, this.options) creates only one, while this.$data._chart.update() seems to actually be producing an infinite loop, as the errors are being thrown and stacking circa every second.

Environment

  • vue.js version: ^2.5.21
  • vue-chart.js version: 3.4.0
  • npm version: 5.6.0

NOTE: I think that the project is awesome, loving it. Keep up the good work! 😃 🍻

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
rafiluriecommented, Mar 14, 2020

Is there an answer to this question? I am having the same problem

0reactions
JStrebeykocommented, Mar 19, 2019

Thanks big time for detailed explanation of nature of the problem, @jonasohrn. Any chance of having the the example modified so it works with no warnings? I want to become a responsible vue-chartjs user, but need some guidence in reactive data implementation! I am sure that codesandbox’ed solution to the issue in question would become helpful to many others like myself. Sending love 💋

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Vue Warning: You may have an infinite update ...
You are getting that warning because Vue has to re-render for each item in the v-for loop, due to the fact that the...
Read more >
Infinite loop when mixing computed and watchers with ".sync ...
The endless loop is caused by the columns prop, despite being static (but not really), the first time you emit the update event,...
Read more >
Just-in-Time Mode - Tailwind CSS
Tailwind CSS v2.1 introduces a new just-in-time compiler for Tailwind CSS that generates your styles on-demand as you author your templates instead of ......
Read more >
vue rangeerror: maximum call stack size exceeded - You.com | The ...
Customize search with apps ... This will cause an infinite loop: ... Vue.js Error in nextTick: "RangeError: Maximum call stack size exceeded" &...
Read more >
Building Table Sorting and Pagination in Vue.js
And then I simply loop over my cats to render each row. The JavaScript is simple: const app = new Vue({ el:'#app', data:{...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found