alexreardon / tiny-invariant

A tiny invariant function
MIT License
1.7k stars 48 forks source link

How to show error message in production? #176

Closed offchan42 closed 9 months ago

offchan42 commented 9 months ago

On production I noticed that it only says "Error: Invariant failed" but it doesn't explain what the error is about. What is the best practice for investigating error with tiny-invariant on the server?

offchan42 commented 9 months ago

OK I realized that the error message isn't supposed to be shown in production. For others wanting to show error messages in production, try Kent's invariant library instead: https://twitter.com/kentcdodds/status/1735094996746019043 https://github.com/epicweb-dev/invariant