Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Auto debugger #191

Open
tylerschloesser opened this issue Apr 17, 2024 · 0 comments
Open

Feature: Auto debugger #191

tylerschloesser opened this issue Apr 17, 2024 · 0 comments

Comments

@tylerschloesser
Copy link

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

  1. 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.
  2. 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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant