You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cyclical callback results in "Error loading dependencies" message, no error message in console. #228
The same issue arises if a network of callbacks is cyclical, eg a callback with element A as an input that outputs to element B, which is the input to a callback that outputs to element A.
Allowing cyclical callbacks would be nice, but there should at least be an error raised indicating the problem. I also can't find anything in the documentation indicating that cyclical callbacks are not possible, but I might not be searching for the right terms.
#125 Seems to have become a catchall for every instance of the "Error loading dependencies" message, regardless of the underlying cause. I thought it would be better to create a separate issue, as I'm fairly certain what the cause is.
Same error here. Got the "Error loading dependencies" message triggered by a trivial cycle (element A <-> element B). @ThomasProctor, have you eventually come with a workaround?
@ThomasProctor This workaround looks pretty accurate ;) And this is eventually what I did.
I agree on the fact that cyclical callbacks would deserve a proper error message.
Even better, they could be taken care of. Unfortunately, I'm personally not skilled enough in web development to do so. The only thing I was able to manage is solving my cyclical issue in React: https://codesandbox.io/s/5yl0y9pww4. But no more :/
I actually found myself in a situation where I'd like to use cyclical callbacks, but with the cycle being broken by raising a "PreventUpdate()" after some condition is met. Is there a way to disable the cycle checking short of editing bundle.js ?
This particular cycle we now do catch on the Python side, with dash.exceptions.SameInputOutputException
However, a nontrivial cycle is still a problem that gives the dreaded "Error loading dependencies" with no indication anywhere what caused it. Here's a simple example, that works fine if you comment out either one of the callbacks but fails with both active:
We need to have the devtools capture and display these errors. I don't see us catching cyclic callbacks on the Python side - even if it worked for the static case it can't work for dynamically-generated callbacks where the back-end doesn't know the whole layout. So the front end will need to have this check, therefore it's redundant to include it in the back end even if in certain cases that would improve the dev experience.
Separately, I'm transferring the issue of allowing cycles and trusting the dev to break them appropriately here from the dash-renderer repo, in prep for merging the two repos -> #730. This issue is just about reporting it when an error is the desired outcome.
@gvwilson might be worth testing the example I gave to see what the current behavior is, but given that there have been no comments for 5 years I bet it’s resolved
Activity
antisrdy commentedon Apr 5, 2018
Same error here. Got the "Error loading dependencies" message triggered by a trivial cycle (element A <-> element B). @ThomasProctor, have you eventually come with a workaround?
ThomasProctor commentedon Apr 26, 2018
@antisrdy I think the workaround is: you're just not supposed to do this.
The bug, as I see it, is that it doesn't tell you what you're doing wrong.
antisrdy commentedon Apr 26, 2018
@ThomasProctor This workaround looks pretty accurate ;) And this is eventually what I did.
I agree on the fact that cyclical callbacks would deserve a proper error message.
Even better, they could be taken care of. Unfortunately, I'm personally not skilled enough in web development to do so. The only thing I was able to manage is solving my cyclical issue in React: https://codesandbox.io/s/5yl0y9pww4. But no more :/
zouhairm commentedon Aug 31, 2018
I actually found myself in a situation where I'd like to use cyclical callbacks, but with the cycle being broken by raising a "PreventUpdate()" after some condition is met. Is there a way to disable the cycle checking short of editing bundle.js ?
nicolaskruchten commentedon Nov 19, 2018
There really should be something in the Python console telling you about the cycle, not just in the JS console.
vtslab commentedon Apr 25, 2019
I published a workaround at:
http://yaaics.blogspot.com/2019/03/circular-references-in-plotlydash.html
As stated in the blog, allowing intended circular references that can be broken with raise PreventUpdate is still the prefered final solution.
alexcjohnson commentedon May 22, 2019
This particular cycle we now do catch on the Python side, with
dash.exceptions.SameInputOutputExceptionHowever, a nontrivial cycle is still a problem that gives the dreaded "Error loading dependencies" with no indication anywhere what caused it. Here's a simple example, that works fine if you comment out either one of the callbacks but fails with both active:
We need to have the devtools capture and display these errors. I don't see us catching cyclic callbacks on the Python side - even if it worked for the static case it can't work for dynamically-generated callbacks where the back-end doesn't know the whole layout. So the front end will need to have this check, therefore it's redundant to include it in the back end even if in certain cases that would improve the dev experience.
Separately, I'm transferring the issue of allowing cycles and trusting the dev to break them appropriately here from the
dash-rendererrepo, in prep for merging the two repos -> #730. This issue is just about reporting it when an error is the desired outcome.gvwilson commentedon Jun 3, 2024
@alexcjohnson may I close this one?
alexcjohnson commentedon Jun 3, 2024
@gvwilson might be worth testing the example I gave to see what the current behavior is, but given that there have been no comments for 5 years I bet it’s resolved