honeybadger-js icon indicating copy to clipboard operation
honeybadger-js copied to clipboard

Source maps not working on nextjs for server files

Open subzero10 opened this issue 2 years ago • 6 comments

Even with https://github.com/honeybadger-io/honeybadger-js/pull/1248, a user is having issues on getting source maps to work for server files.

Front logo Front conversations

subzero10 avatar Nov 17 '23 19:11 subzero10

Any update on this?

maxkostow avatar Jan 19 '24 18:01 maxkostow

Hey @maxkostow, I'm trying source maps with a nextjs example app.

I've setup this project and deployed to Vercel. Note the use of NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA to set the value for the revision property in both next.config.js and honeybadger.*.config.js files. I configured the following env variables on Vercel:

  • NEXT_PUBLIC_HONEYBADGER_ASSETS_URL = https://example-nextjs-dashboard.vercel.app/_next
  • NEXT_PUBLIC_HONEYBADGER_API_KEY = MY_PROJECT_API_KEY

The project comes with button to send a manual report to Honeybadger. You can see it here.

These errors show up with the expected source map applied on Honeybadger: image

Is it possible to share an example repository where source maps are not working for you so that I can try on that project as well?

subzero10 avatar Jan 26 '24 21:01 subzero10

That appears to be a client component (not the use client at the top of the file) so would not run on the server.

I'm now noticing that the github issue does not mention it, but on the support ticket I believe it is mentioned that this is for server side sourcemaps; the client side ones are working.

maxkostow avatar Jan 26 '24 23:01 maxkostow

Ah yes you are right. I'll look into that then!

subzero10 avatar Jan 27 '24 06:01 subzero10

Any update on this? As you can imagine it is quite problematic for debugging. If this cannot be resolved we will have to consider moving to another error tracking provider. Unfortunate since otherwise honeybadger has been quite nice for us.

maxkostow avatar Feb 23 '24 21:02 maxkostow

Hey @maxkostow, apologies for not getting back sooner. I did have a look into this but it's not a simple task. I can't give you a timeline, but I will tell you that it's in our plans to work on getting source maps for server files.

subzero10 avatar Mar 16 '24 05:03 subzero10