The simplest custom watcher causes console errors [Vue warn] regarding infinite loop
See original GitHub issueExpected 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
- Create a custom component importing, say,
{ Line } from 'vue-chartjs';
; - Create a button clicking upon which changes, say, labels for the chart data object.
- Realize that
mixins.reactiveProp
does not penetrate data object deeply enough to reach thelabels
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. - Create a simple custom watcher instead, whether it be with
this.renderChart(this.data, this.options)
orthis.$data._chart.update()
callbacks to watch overdata
/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:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there an answer to this question? I am having the same problem
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 💋