`Unhandled error during execution of scheduler flush. This is likely a Vue internals bug.`.
Version
3.0.6
Reproduction link
https://github.com/Fanna1119/vue3-flush-error
Steps to reproduce
Run project as usual:
After changing the input a second time the error occurs.
Unhandled error during execution of scheduler flush. This is likely a Vue internals bug.
.
Alongside an execution error of the function from a 3rd party library. ( the function runs fine the first time.)
What is expected?
the watcher to initiate the change with appropriate flushing. (maybe an error somewhere around the lifecycle?)
What is actually happening?
the watcher throws a flush error after the second watch change when re-executing the function
you use sliderRef
to hold an instance of that 3rd party plugin, but then you also use it as a template ref on the canvas element. So the plugin instance is replaced with the canvas DOM element and canvas elements don't have a setSliderValue
method.
Solution: don't use the same ref for both purposes, that doesn't make sense.