Skip to content

fix(elysia): Use node transport by default on Node.js - #24774

Open
sx4im wants to merge 1 commit into
getsentry:developfrom
sx4im:fix/elysia-transport-by-runtime
Open

sx4im wants to merge 1 commit into
getsentry:developfrom
sx4im:fix/elysia-transport-by-runtime

Conversation

@sx4im

@sx4im sx4im commented Sep 27, 2026

Copy link
Copy Markdown

init() in the Elysia SDK unconditionally defaulted to Bun's fetch transport, even when running on Node.js. That silently replaced the node transport, losing proxy support (http_proxy/HTTPS_PROXY), custom CA handling via NODE_EXTRA_CA_CERTS, and keep-alive agent tuning for anyone running Elysia on Node behind a corporate proxy.

This picks the default transport by detected runtime, the same way getRuntime() already detects it: makeFetchTransport on Bun, makeNodeTransport everywhere else. An explicitly provided transport option is still respected, and no dependency structure changes — @sentry/bun already re-exports makeNodeTransport from @sentry/node.

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.

Fixes #24048

Notes on verification: yarn test in packages/elysia passes (33/33, including a new regression test that failed before the fix). yarn lint reports 8 errors in the package, all pre-existing on the untouched tree (unbuilt @sentry/bun types in this environment; the change removes one of them and adds none). A full yarn build:dev is blocked by a pre-existing server-utils types failure from vite version drift, unrelated to this change; the elysia transpile build succeeds.

The Elysia SDK unconditionally defaulted to Bun's fetch transport, even
when running on Node.js. That silently replaced the node transport and
lost proxy support (http_proxy/HTTPS_PROXY), custom CA handling via
NODE_EXTRA_CA_CERTS, and keep-alive agent tuning for anyone running
Elysia on Node behind a corporate proxy.

Select the default transport by runtime, the same way getRuntime()
already detects it: keep makeFetchTransport on Bun, use
makeNodeTransport everywhere else. An explicitly provided transport
option is still respected.

Co-Authored-By: Muse Spark <noreply@meta.com>
@sx4im
sx4im marked this pull request as ready for review September 27, 2026 06:43
@sx4im
sx4im requested a review from a team as a code owner September 27, 2026 06:43
@sx4im
sx4im requested review from nicohrubec and s1gr1d and removed request for a team September 27, 2026 06:43

This branch has not been deployed

No deployments
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.

Elysia on Node uses Bun's fetch transport

1 participant