Skip to content

Commit 090a3e3

Browse files
authored
fix(node): tracingChannel export missing in older node versions (#18191)
I guess this got through CI because we test latest 18 rather than 18.0.0. This breaks [some supported Electron versions](https://github.com/getsentry/sentry-electron/actions/runs/19306230917/job/55215745023) which are using >18.0.0 but <18.19.0. This wont have impacted almost anyone else because Otel requires 18.19.0! ``` [App] [ Main] App threw an error during load [App] [ Main] file:///home/runner/work/sentry-electron/sentry-electron/test/e2e/dist/error-after-ready/node_modules/@sentry/node-core/build/esm/integrations/pino.js:1 [App] [ Main] import { tracingChannel } from 'node:diagnostics_channel'; [App] [ Main] ^^^^^^^^^^^^^^ [App] [ Main] SyntaxError: The requested module 'node:diagnostics_channel' does not provide an export named 'tracingChannel' [App] [ Main] at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21) [App] [ Main] at async ModuleJob.run (node:internal/modules/esm/module_job:190:5) [App] [ Main] A JavaScript error occurred in the main process ```
1 parent 2deb000 commit 090a3e3

File tree

1 file changed

+3
-3
lines changed
  • packages/node-core/src/integrations

1 file changed

+3
-3
lines changed

packages/node-core/src/integrations/pino.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { tracingChannel } from 'node:diagnostics_channel';
1+
import * as diagnosticsChannel from 'node:diagnostics_channel';
22
import type { Integration, IntegrationFn, LogSeverityLevel } from '@sentry/core';
33
import {
44
_INTERNAL_captureLog,
@@ -122,8 +122,8 @@ const _pinoIntegration = defineIntegration((userOptions: DeepPartial<PinoOptions
122122
},
123123
});
124124

125-
const injectedChannel = tracingChannel('orchestrion:pino:pino-log');
126-
const integratedChannel = tracingChannel('pino_asJson');
125+
const injectedChannel = diagnosticsChannel.tracingChannel('orchestrion:pino:pino-log');
126+
const integratedChannel = diagnosticsChannel.tracingChannel('pino_asJson');
127127

128128
function onPinoStart(self: Pino, args: PinoHookArgs, result: PinoResult): void {
129129
if (!shouldTrackLogger(self)) {

0 commit comments

Comments
 (0)