3 ms·
I can never get watched variables to work. The scoping and updating rules for it are a mystery to me. I assume only global variables can be watched, but even th
by russellbeattie 3y ago
I can never get watched variables to work. The scoping and updating rules for it are a mystery to me. I assume only global variables can be watched, but even then it never works as I expect, so I end up just flooding the log with values when testing.
I've thought for years the console should add Data.gui [1] style UI for viewing/testing variable and settings values. You can see it action on this CodePen [2].
1. https://github.com/dataarts/dat.gui https://github.com/dataarts/dat.gui
2. https://codepen.io/russellbeattie/full/kGxaqM https://codepen.io/russellbeattie/full/kGxaqM
- altano 3y agoDisable source maps in the debugger. They are likely the source of your frustration and frankly I still do not understand why they are on by default given how bad the experience is of actively debugging with them on.
- altano 3y agoYour comment made me want to scratch this long-standing itch and write-up why you should disable source maps. Check this out: https://alan.norbauer.com/articles/disable-source-maps https://alan.norbauer.com/articles/disable-source-maps
- 20after4 3y agoI've had the same frustration. The browsers have such great debugging features, in theory, but they never seem to work reliably. I can't even get all of my breakpoints to reliably hit. Everything seems to work ok when the code is unrolled but as soon as it gets bundled, even if not minified, it seems that a lot of debugger features get broken, at least that's been my experience. Note: I'm not a front-end engineer and I'm probably doing something wrong.
- iudqnolq 3y agoEven though minified variables appear under the correct name in the sidebar panel in chrome I still get an error that they're undefined in a watchpoint, which is annoying.