honeybadger-js
honeybadger-js copied to clipboard
Incompatible with nextjs v15
What are the steps to reproduce this issue?
- Create a project with nextjs version 15
- Set up honeybadger for nextjs
- Build the application
What happens?
Build fails with:
⚠ Invalid next.config.js options detected:
⚠ Unrecognized key(s) in object: 'serverComponentsExternalPackages' at "experimental"
⚠ See more info here: https://nextjs.org/docs/messages/invalid-next-config
⚠ `experimental.serverComponentsExternalPackages` has been moved to `serverExternalPackages`. Please update your next.config.js file accordingly.
What were you expecting to happen?
Build doesn't fail
Any logs, error output, etc?
See above
Any other comments?
This is because of an incorrect version check here. This line checks if the major version is greater than 14 and the minor version is greater than 3 (regardless of the major version). Instead the check should read something like: (+nextJsVersion[0] === 14 && +nextJsVersion[1] >= 3) || +nextJsVersion[0] > 14
What versions are you using?
Operating System: … Package Name: … Package Version: … Browser Version: …
Fix here: https://github.com/honeybadger-io/honeybadger-js/pull/1415
I actually noticed another error: Honeybadger (the react package specifically) imports Component from react. I receive an error now during build stating that react doesn't export Component. When I run the compiled application I get an error because of the missing Component. I have no clue if this is a nextjs bug. I know they do some precompiling of react and other libraries and make it part of the bundle. It seems this issue is related: https://github.com/vercel/next.js/issues/60890. Happens with the same repro above.
Hey @phikes, thanks for reporting this!
I actually noticed another error: Honeybadger (the react package specifically) imports Component from react. I receive an error now during build stating that react doesn't export Component. When I run the compiled application I get an error because of the missing Component. I have no clue if this is a nextjs bug. I know they do some precompiling of react and other libraries and make it part of the bundle. It seems this issue is related: https://github.com/vercel/next.js/issues/60890. Happens with the same repro above.
I've seen your PR (much appreciated!), I am planning to take another look my self with nextjs v15 as well.
Also experiencing this and have HB turned off on our production frontend as a result 😟
This should have been fixed with #1435.
@phikes and @ssyberg, can you please try with the latest version of @honeybadger-io/nextjs ?
Note: I think you'll have to modify your honeybadger.config.edge.js and honeybadger.config.server.js to import Honeybadger from @honeybadger-io/js:
- import { Honeybadger } from '@honeybadger-io/react'
+ import Honeybadger from '@honeybadger-io/js'
Sorry for taking a while to come back to you, @subzero10 . After finally deploying the update today I can confirm it working.
I have just received my first frontend error through honeybadger again.
Awesome, thanks for confirming! As always, don't hesitate to reach out if something else comes up; we'll be happy to help!