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

feat: nextjs integration #1030

Merged
merged 14 commits into from
Apr 14, 2023
Merged

feat: nextjs integration #1030

merged 14 commits into from
Apr 14, 2023

Conversation

subzero10
Copy link
Member

@subzero10 subzero10 commented Mar 6, 2023

Status

READY

Description

Closes: #1023
A nextjs dedicated package that simplifies integration with nextjs:

  • server integration
  • client integration
  • source map upload

Todos

@subzero10 subzero10 added the nextjs @honeybadger-io/nextjs label Mar 6, 2023
@subzero10 subzero10 self-assigned this Mar 6, 2023
@subzero10
Copy link
Member Author

subzero10 commented Mar 9, 2023

Just realized that I will have to find a way to publish an alpha version of the package without Lerna (so I can test with Vercel deployments).
Our current Lerna setup uses fixed mode, which uses same versioning strategy for all packages and I don't want to change that at the moment.
It should be easily done with the npm cli.

@subzero10
Copy link
Member Author

I'm sad to realize that it's no easy task to install a package from the monorepo without an npm publish.
I came across gitpkg, but it's not working for me. They have an open issue and I commented.

@subzero10
Copy link
Member Author

Update:

  • The HB client can now report errors either from server, browser or vercel edge.
  • However, it won't always work because of some strange caveats of Nextjs/Vercel. For example, this one makes it difficult to report an error that comes from an error thrown in an api route, because Nextjs renders a 404 status code 🤷 . Additionally, there is no information about the error at all. As a result, a different way is to be implemented to handle those cases, which I plan to do with a separate issue/PR.

I will pause here as far as "the reporting to Honeybadger" task goes and focus on the next points in the todo list above. I will document known limitations, so we can create issues to improve them.

@subzero10
Copy link
Member Author

Update:
I integrated the webpack plugin so now source maps are automatically uploaded. They are working for server and browser runtimes. They are not working for the vercel edge runtime.
I haven't decided if I should work on this or if I should focus on getting the first version of this package out there (remaining todo items); I'm leaning towards the latter.

@subzero10
Copy link
Member Author

Hey @BethanyBerkowitz, @joshuap and @stympy,

I think this is ready for review. I have some more testing to do, but you should be able to get started with the review.

@subzero10
Copy link
Member Author

I will merge this so that the package will be published on npm. Then, I will be able to do end-to-end testing with our example repository.

@subzero10 subzero10 merged commit 695abec into master Apr 14, 2023
@subzero10 subzero10 deleted the nextjs_client_#1023 branch April 14, 2023 08:57
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 this pull request may close these issues.

Next.js dedicated package
2 participants