This is actually a feature request. I would of course be glad to be directed toward some existing solution.
I very often want to debug via browser devtools when an invariant fails. I do this one of two ways
Set a conditional breakpoint on the invariant where the condition is the inverse of the invariant. This is not always possible/easy if the invariant is nontrivial. I also often forget to remove this breakpoint and have to do so later.
Temporarily refactory/copy my invariant like so
// invariant(val)
if (!val) { debugger }
I've never been able to rely on exception breakpoints (caught or uncaught) due to e.g. React.
I'd love some sort of ability to have my invariants automatically open a debugger. Either configured globally (invariant.debugOnFailure = true) or per instance (invariant.debug(val))
This is actually a feature request. I would of course be glad to be directed toward some existing solution.
I very often want to debug via browser devtools when an invariant fails. I do this one of two ways
I've never been able to rely on exception breakpoints (caught or uncaught) due to e.g. React.
I'd love some sort of ability to have my invariants automatically open a debugger. Either configured globally (
invariant.debugOnFailure = true
) or per instance (invariant.debug(val)
)