honeybadger-io / honeybadger-js

Universal JavaScript library for reporting errors to Honeybadger.io :zap:
https://www.honeybadger.io/for/javascript/
MIT License
107 stars 62 forks source link

Webpack plugin inappropriately logs that there are no files to upload #980

Closed BethanyBerkowitz closed 1 year ago

BethanyBerkowitz commented 1 year ago

What are the steps to reproduce this issue?

  1. I forked https://github.com/honeybadger-io/nextjs-with-honeybadger and deployed it to vercel
  2. Check the logs in vercel and I see both "no assets" error and logging that suggests the sourcemaps were correctly uploaded

What happens?

Screen Shot 2022-12-12 at 10 17 34 AM

It's logging both that there are no assets to upload, and that it successfully uploaded sourcemaps. One of these logs is wrong.

What were you expecting to happen?

Either there are no assets, or there are assets uploaded, not both!

Any logs, error output, etc?

See above

subzero10 commented 1 year ago

I'm keen to know more about this. Here's an issue where I looked into a little bit. Basically, I came to realize that next.js runs the "build" command multiple times simultaneously (for different purposes), and in some of those cases, it doesn't generate source maps.

BethanyBerkowitz commented 1 year ago

I'm keen to know more about this. Here's an issue where I looked into a little bit. Basically, I came to realize that next.js runs the "build" command multiple times simultaneously (for different purposes), and in some of those cases, it doesn't generate source maps.

Yeah, I looked into this a bit on Monday and found the same thing. At first I was wondering if it just "emits" assets several times, causing the afterEmit hook to fire multiple times for one build. However, I checked the done hook and that one gets fired multiple times too, so it's definitely running the "build" command more than once.

So yes, this logging is pretty confusing for the user, but I don't know that we can do much about it.

BethanyBerkowitz commented 1 year ago

Since we now understand and have documented the cause of this and there's not an obvious way to fix it, I'm inclined to close this for now.