Skip to content

fix(hono): Return the existing client on repeated init in Bun and Deno - #24520

Open
Shubham-Padkonde wants to merge 1 commit into
getsentry:developfrom
Shubham-Padkonde:fix/hono-bun-deno-double-init
Open

Shubham-Padkonde wants to merge 1 commit into
getsentry:developfrom
Shubham-Padkonde:fix/hono-bun-deno-double-init

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

On Bun and Deno, init() warned when Sentry was already initialized but then initialized again, replacing the client. Anything buffered on the first client was dropped and its integrations stayed installed against it.

Both now keep the warning and return the existing client, as the Node entry already does. Node's behavior is unchanged (it only logs in debug mode, since it is initialized from an instrument file); Cloudflare initializes per request through withSentry and is not affected.

  • Tests: the Bun and Deno double-init tests now expect no re-initialization, plus a test that init() returns the existing client. These fail before this change; vitest run for the hono Bun/Deno/Node tests passes (67 tests).
  • oxfmt --check passes on the changed files. oxlint reports the same results as before the change in my environment.

Closes #24049

🤖 Generated with Claude Code

On Bun and Deno, init() warned when Sentry was already initialized but
then initialized again, replacing the client. Anything buffered on the
first client was dropped and its integrations stayed installed against it.
Keep the warning and return the existing client, as the Node entry does.

Fixes getsentry#24049

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Shubham-Padkonde
Shubham-Padkonde requested a review from a team as a code owner September 19, 2026 09:30
@Shubham-Padkonde
Shubham-Padkonde requested review from mydea and s1gr1d and removed request for a team September 19, 2026 09:30
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.

hono: Double init() behaves differently per runtime

1 participant