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

Server side errors are not monitored correctly in NextJS app directory #1114

Open
mcAnastasiou opened this issue Jun 28, 2023 · 2 comments
Open
Assignees
Labels
nextjs @honeybadger-io/nextjs

Comments

@mcAnastasiou
Copy link

What are the steps to reproduce this issue?

  1. Download current repository and run the nextJS app directory example
  2. Visit http://localhost:3000/data-fetching?fail=true

What happens?

In honeybadger you see the following error
Screenshot 2023-06-28 at 14 59 20

Screenshot 2023-06-28 at 14 59 49

and on server logs
Screenshot 2023-06-28 at 15 00 55

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

@subzero10
Copy link
Member

subzero10 commented Jun 29, 2023

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.

@subzero10 subzero10 self-assigned this Jun 29, 2023
@subzero10 subzero10 added the nextjs @honeybadger-io/nextjs label Jun 29, 2023
@mcAnastasiou
Copy link
Author

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.

Thank you! i will subscribe to that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nextjs @honeybadger-io/nextjs
Projects
None yet
Development

No branches or pull requests

2 participants