File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,6 @@ const result = await build({
8989 entryPoints : [ "./src/bin.ts" ] ,
9090 bundle : true ,
9191 minify : true ,
92- alias : { } ,
9392 banner : {
9493 // Check Node.js version (>= 22 required for node:sqlite) and suppress warnings
9594 js : `#!/usr/bin/env node
Original file line number Diff line number Diff line change @@ -338,6 +338,14 @@ export function initSentry(
338338 const isBun = typeof process . versions . bun !== "undefined" ;
339339 const runtime = isBun ? "bun" : "node" ;
340340
341+ // LightNodeClient hardcodes runtime to { name: 'node' }. Override it so
342+ // events carry the correct runtime when running as a compiled Bun binary.
343+ const opts = client . getOptions ( ) ;
344+ opts . runtime = {
345+ name : runtime ,
346+ version : isBun ? process . versions . bun : process . version ,
347+ } ;
348+
341349 // Tag whether running as bun binary or node (npm package).
342350 // Kept alongside the SDK's promoted 'runtime' tag for explicit signaling
343351 // and backward compatibility with existing dashboards/alerts.
Original file line number Diff line number Diff line change @@ -21,13 +21,13 @@ import {
2121
2222describe ( "createBeforeExitHandler" , ( ) => {
2323 /**
24- * Create a minimal mock BunClient for testing the beforeExit handler.
24+ * Create a minimal mock LightNodeClient for testing the beforeExit handler.
2525 * Only needs flush() since that's all the handler uses from the client.
2626 */
27- function createMockClient ( ) : Sentry . BunClient {
27+ function createMockClient ( ) : Sentry . LightNodeClient {
2828 return {
2929 flush : ( ) => Promise . resolve ( true ) ,
30- } as unknown as Sentry . BunClient ;
30+ } as unknown as Sentry . LightNodeClient ;
3131 }
3232
3333 test ( "ends OK session on beforeExit" , ( ) => {
You can’t perform that action at this time.
0 commit comments