Debugging Dash on localhost

Most bugs / errors are either caught in the console or browser console. However, there have been a few times when nothing appears in either of the two.

In such instances, what is your line of debugging? How do you attempt to traceback the issue? Are there any other tools that could help with debugging dash app issues locally?

Could you please elaborate a bit more on any of the examples when that type of errors do not print traces?

In my case, most of these scenarios occured when there was no error at all, but the functioning was different from the expected one (which is actually not an error itself, but a wrong solution of the problem).

My experience on localhost is that if the error happens before the Dash app is up and running, then its in the Console. This is typically when the Dash app was already live, and I made some erroneous change to the code. The code change triggers a refresh of the app in the browser and the error occurs during the refresh.

In all other cases, the error is triggered by some user action, and these are reported in the browser console.

If as pointed out by asdrgil, if its not a “code error” but a “wrong solution”, then the typical strategy for me is to go through the code line by line using a debugger (e.g., PDB) and print relevant variables at each step to see where the logic is wrong.