Improved error messages #328
josh-degraw
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There are a few places where an error is thrown without any message (e.g. when a duplicate route id is found, when using
useRouter
outside of context, etc.).It looks like in these situations a console warning is supposed to be logged before the error is thrown when in development mode. This makes sense at the surface. But I'm trying to test out converting from React Router and for some reason, although my environment is in dev mode, I am getting served the production file from

node_modules
, and so I'm being met with a blank screen and a completely useless error message in the console:Although I think I've identified the source code location, it took me a long time and involved having to open up the source code in GitHub.
I would argue that if an error is thrown, it should always have a meaningful message, even (especially?) in a production environment. I'm still working through trying to figure out the root cause of the issues on my side, but the short version of my request is that even just including the same message as in the warning in the Error would have improved my development cycle dramatically, and I might have already found the source of my problem(s) by now. I'd be happy to submit a PR for this change if it's acceptable.
Beta Was this translation helpful? Give feedback.
All reactions