honeybadger-js
honeybadger-js copied to clipboard
Server side errors are not monitored correctly in NextJS app directory
What are the steps to reproduce this issue?
- Download current repository and run the nextJS app directory example
- Visit http://localhost:3000/data-fetching?fail=true
What happens?
In honeybadger you see the following error
and on server logs
What were you expecting to happen?
The error should display the source code instead. Have tested the same behavior in Sentry and it works fine.
Any other comments?
It seems that before notify is not being executed in honeybadger.server.config.js. I added a console log and nothing is being displayed in the console. Probably this is the place that it handles the source map
Current behavior cannot be used in production, because the line code as you can see in the screenshot, is the one in production javascript file and not the source one. This makes it impossible to debug it when an error occurs
Hey @mcAnastasiou,
Thanks for testing this out!
Indeed, Next.js by default replaces the real error message with a generic one for better security when reporting a server error.
You can use the digest field to find the error message in your server's logs. Obviously, this is not ideal.
I think Sentry uses a different approach in catching and reporting errors, and all of this should be tackled with #1055.
Hey @mcAnastasiou,
Thanks for testing this out!
Indeed, Next.js by default replaces the real error message with a generic one for better security when reporting a server error. You can use the
digestfield to find the error message in your server's logs. Obviously, this is not ideal.I think Sentry uses a different approach in catching and reporting errors, and all of this should be tackled with #1055.
Thank you! i will subscribe to that issue