#[node] logger not found on Sentry import

3 messages · Page 1 of 1 (latest)

elder prism
#

I've wanted to use the Sentry logger but it can't find it.
I have this setup:

// instrument.ts

import * as Sentry from "@sentry/node";

Sentry.init({
  dsn: process.env.SENTRY_DSN,

  // Tracing
  tracesSampleRate: 1.0, //  Capture 100% of the transactions

  _experiments: { enableLogs: true },
});

// index.ts (for example)
import "./utils/instrument.js";
import * as Sentry from "@sentry/node";
const { logger } = Sentry;

Does Anybody else have this issue?

Sidenote: I've used @sentry/sveltekit before and it worked there. With @sentry/node it doesn't somehow.

Versions

  • @sentry/cli - 2.46.0
  • @sentry/node - 8.55.0
#

nvm, pnpm was mocking and didn't install the latest version. I had to remove and add the @sentry/node package.

hushed latch
#

also, logs is available on v9.17 and newer