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

Thousands of errors occur when @honeybadger-io/js is installed in a Next.js project #1320

Open
GabeMeister opened this issue Mar 26, 2024 · 3 comments · Fixed by #1420
Open
Assignees
Labels
nextjs @honeybadger-io/nextjs

Comments

@GabeMeister
Copy link

What are the steps to reproduce this issue?

  1. Create a Next.js app with Next 14
  2. Run through the steps to install honeybadger within a Next.js project here.
  3. Also run yarn add @honeybadger-io/js to add honeybadger's js package
  4. Create an error on the page, and observe a ton of errors showing up in Honeybadger when Honeybadger goes to run client.notify() in the browser.

What happens?

For Next.js projects, the docs only say to install @honeybadger-io/react and @honeybadger-io/nextjs npm packages, it subtly leaves off @honeybadger-io/js. However, to someone who's new to Honeybadger and getting it setup, this can be often be missed and assumed the @honeybadger-io/js package should also be installed (Next.js and React is all JavaScript after all, right?). However, when this package is installed and it's not the same version, we got a lot of very confusing errors, and ended up needing to pay extra since we exceeded our error quota for our package (over 100,000 errors). My theory is that when we are importing Honeybadger from @honeybadger-io/jsit's importing from the wrong npm module version, and it causes a problem.

What were you expecting to happen?

No errors occur, or the Honeybadger package gives us a big warning saying we need to uninstall the @honeybadger-io/js package.

Any logs, error output, etc?

Our app got over 100,000 errors in a span of 24 hours, with an exception message that says UnhandledPromiseRejectionWarning: Object Not Found Matching Id:5, MethodName:update, ParamCount:4.

What versions are you using?

Operating System: Fly.io app running on Alpine Linux v3.19, browser running on Ubuntu 23.03
Package Name: @honeybadger-io/js, @honeybadger-io/react, @honeybadger-io/nextjs
Package Version: "@honeybadger-io/js": "^6.2.0", "@honeybadger-io/nextjs": "^5.8.12", "@honeybadger-io/react": "^6.1.8",
Browser Version: Chrome 122.0.6261.94

@subzero10 subzero10 self-assigned this Mar 30, 2024
@subzero10 subzero10 added the nextjs @honeybadger-io/nextjs label Mar 30, 2024
@subzero10
Copy link
Member

subzero10 commented Mar 30, 2024

Hey @GabeMeister, I'm sorry that you had this experience while setting up Honeybadger for the first time.

we got a lot of very confusing errors, and ended up needing to pay extra since we exceeded our error quota for our package (over 100,000 errors).

If this happens again, don't hesitate to reach out to our support ([email protected]) and we'll help you out with your error quota, even more so when the root cause is on our side! cc @stympy @joshuap

the Honeybadger package gives us a big warning saying we need to uninstall the @honeybadger-io/js package.

The issue here is not that you have to uninstall the @honeybadger-io/js package. The package is a required dependency of the @honeybadger-io/nextjs package and it's mentioned at the top of the docs. Usually npm (or yarn) will stop you from installing dependencies that are not compatible. What happened here is that a breaking change was introduced between the js and nextjs packages and the peerDependencies of the nextjs package were not updated to protect from such issues. We use Lerna for package versioning in this monorepo which does not make any changes to peerDependencies automatically. Hence, we tend to manually update them when we have major version releases, but once in a while we might get into a situation such as the one you faced.

I will update the minimum version of the js. package in peerDependencies of the nextjs package and that way npm (or yarn) will tell you if the dependencies are not compatible.

Before I do that though, can you please clarify which version of @honeybadger-io/js, @honeybadger-io/nextjs and @honeybadger-io/react you have running now?

@tommycrumrine
Copy link

tommycrumrine commented Jan 15, 2025

We are seeing this same issue now using @honeybadger-io/vue and the rollup plugin for sourcemaps. Here's the relevant section of our yarn.lock, doesn't look like we have multiple versions of @honeybadger-io/js

"@honeybadger-io/core@^6.6.0":
  version "6.6.0"
  resolved "https://registry.yarnpkg.com/@honeybadger-io/core/-/core-6.6.0.tgz#a18782ffdb4b8bdc0c36076bd330fb6c6ada1060"
  integrity sha512-B5X05huAsDs7NJOYm4bwHf2v0tMuTjBWLfumHH9DCblq8E1XrujlbbNkIdEHlzc01K9oAXuvsaBwVkE7G5+aLQ==
  dependencies:
    json-nd "^1.0.0"
    stacktrace-parser "^0.1.10"

"@honeybadger-io/js@^6.10.1":
  version "6.10.1"
  resolved "https://registry.yarnpkg.com/@honeybadger-io/js/-/js-6.10.1.tgz#20b88e9ced48e2a50211415a4ea08f5df047e1c5"
  integrity sha512-T5WAhYHWHXFMxjY4NSawSY945i8ISIL5/gsjN3m0xO+oXrBAFaul3wY5p/FGH6r6RfCrjHoHl9Iu7Ed9aO9Ehg==
  dependencies:
    "@honeybadger-io/core" "^6.6.0"
    "@types/aws-lambda" "^8.10.89"
    "@types/express" "^4.17.13"

"@honeybadger-io/plugin-core@^1.4.1":
  version "1.4.1"
  resolved "https://registry.yarnpkg.com/@honeybadger-io/plugin-core/-/plugin-core-1.4.1.tgz#6781fb02b3a96ef961d25bf9803517e1dd41af38"
  integrity sha512-p4fNPwAm7G2z24lx4gBBWjCrD4YfAgGqRMNI9es4WYe94bbukuIzr2d+x0qv09QkIWh/RyhejnIqe0pegj2LSw==
  dependencies:
    fetch-retry "^5.0.3"
    form-data "^4.0.0"
    node-fetch "^2.6.9"

"@honeybadger-io/rollup-plugin@^5.10.1":
  version "5.10.1"
  resolved "https://registry.yarnpkg.com/@honeybadger-io/rollup-plugin/-/rollup-plugin-5.10.1.tgz#cf6c77aea07a39becbf89ab40982b957071044fd"
  integrity sha512-BgYGkRlFmef5KD5ZEARDKiiYHAgP7CTs6Wi2XRek60OoR/nD+9u3nrWLpmRFiSSw/sczvtDRZ13FqeK33pIelg==
  dependencies:
    "@honeybadger-io/plugin-core" "^1.4.1"
    fetch-retry "^5.0.3"
    form-data "^4.0.0"
    node-fetch "^2.6.9"
    picomatch "^2.3.1"

"@honeybadger-io/vue@^6.2.0":
  version "6.2.0"
  resolved "https://registry.yarnpkg.com/@honeybadger-io/vue/-/vue-6.2.0.tgz#b94257d39baab2ad4f61111a5db2e0c662605a88"
  integrity sha512-AGWxQYCdgQw4IKCelNBo8G7h0WHrxvI6a/GrRcqJuJaGeSg7cRqnxtysrK3w1bWTFrHoJa99cOKxj7uIFnlbhg==

@joshuap
Copy link
Member

joshuap commented Jan 23, 2025

@subzero10 should we reopen this?

@subzero10 subzero10 reopened this Jan 23, 2025
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

Successfully merging a pull request may close this issue.

4 participants