Skip to content

feat(hono): Emit warning if @sentry/node was imported instead of @sentry/hono/node#21240

Merged
s1gr1d merged 3 commits into
developfrom
sig/hono-warn-if-node
May 29, 2026
Merged

feat(hono): Emit warning if @sentry/node was imported instead of @sentry/hono/node#21240
s1gr1d merged 3 commits into
developfrom
sig/hono-warn-if-node

Conversation

@s1gr1d
Copy link
Copy Markdown
Member

@s1gr1d s1gr1d commented May 29, 2026

The Hono Node setup requires a separate instrumentation file with the Sentry.init() call. It's important that init is imported from the Hono SDK and not Node. As this could easily be overlooked, but is very important for the correct setup, this warning is added.

@s1gr1d s1gr1d requested a review from a team as a code owner May 29, 2026 09:08
@s1gr1d s1gr1d requested review from mydea and nicohrubec and removed request for a team May 29, 2026 09:08
if (!isInitializedWithHonoSdk) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: so this one we want to always show and the other warnings only as debug logs? is that intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's intentional as it should always be shown (it's pretty important). The first log is also pretty important, I'm gonna change this to console. The third log in the file is really just a debug log.

@s1gr1d s1gr1d enabled auto-merge (squash) May 29, 2026 09:39
@s1gr1d s1gr1d merged commit 048ce20 into develop May 29, 2026
48 checks passed
@s1gr1d s1gr1d deleted the sig/hono-warn-if-node branch May 29, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants