getsentry / getsentry/sentry-javascript

Elysia on Node reports `runtime: {name: 'bun', version: 'unknown'}`

Offen Anfängerfreundlich
#24,047 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Bug Bun javascript
Vorherrschende Sprache
TypeScript
Sterne
8.7k
Forks
1.8k
Ø Merge
1 T. 17 Std.
Gemergte PRs (30 T.)
523

Beschreibung

`elysia/src/sdk.ts:46` sets `runtime: getRuntime()`, which correctly returns `{name:'node'}` off Bun. Then `bun/src/sdk.ts:145` spreads the user options and overwrites `runtime` with its own hard-coded Bun value. Every Elysia-on-Node event is attributed to the wrong runtime. There is an `elysia-node` e2e app, so this configuration is supported.

**Work item** Make `bun/src/sdk.ts:148` respect a caller-supplied `runtime` (only default it when absent), matching `packages/node/src/sdk/client.ts:47`. Assert both runtimes in the Bun tests, and again in the Elysia tests.

**Prior art**: [#19269]() is the same bug one layer up: "`NodeClient` always overrides runtime context to 'node', ignoring Bun SDK's runtime option". It was fixed by making `NodeClient` respect a caller-supplied value, which is now `packages/node/src/sdk/client.ts:47`:

```ts
runtime: options.runtime || { name: 'node', version: global.process.version },
```

`packages/bun/src/sdk.ts:145` still does the unconditional override that #19269 removed from `NodeClient`, so any SDK wrapping `@sentry/bun` hits it. Apply the same one-line remedy there.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with packages/bun/src/sdk.ts:145-148 and compare its runtime handling with packages/node/src/sdk/client.ts:47. Update the Bun tests and the elysia-node e2e tests to assert both runtime values, including a caller-supplied runtime. Done means Elysia on Node reports Node while Bun still reports Bun.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
88/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.