Skip to content

hono: Double init() behaves differently per runtime #24049

Description

@isaacs
node : same client after 2nd init? true | release now: 1.0.0
bun : same client after 2nd init? false | release now: 2.0.0
(plus a console warning)

hono/src/node/sdk.ts:15 returns the existing client and skips re-initialization. hono/src/bun/sdk.ts:17 and hono/src/deno/sdk.ts:17 warn and then re-initialize anyway, replacing the client. Anything buffered on the first client is dropped, and its integrations stay installed against a dead client.

The Hono docs tell users to init through the sentry() middleware, so a user who also calls Sentry.init() hits exactly this path.

Work item. Make all four entries behave the same way. Returning the existing client (the Node behavior) is the safer default. Keep the loud warning from bun/deno on all of them.

**Prior art **#21176 asked for the Bun middleware to follow the Node pattern. #21195 closed it by adding the warning only. The behavior divergence this item describes is what is left over: bun and deno warn and then re-initialize anyway.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBunjavascriptPull requests that update javascript code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions