Skip to content

Commit 35c7ef4

Browse files
fix(node): Update node tracing ESM imports. (#4876)
* fix(node): Update node tracing ESM imports. * Update src/includes/getting-started-config/node.mdx Co-authored-by: Katie Byers <[email protected]> * Rename required variable in CJS example. Co-authored-by: Katie Byers <[email protected]>
1 parent 1e25d64 commit 35c7ef4

File tree

1 file changed

+6
-2
lines changed
  • src/includes/getting-started-config

1 file changed

+6
-2
lines changed

src/includes/getting-started-config/node.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ Once this is done, Sentry's Node SDK captures all transactions and unhandled exc
44
import * as Sentry from "@sentry/node";
55

66
// Importing @sentry/tracing patches the global hub for tracing to work.
7-
import * as Tracing from "@sentry/tracing";
7+
import "@sentry/tracing";
8+
9+
// If you want to use `@sentry/tracing` in your project directly, use a named import instead:
10+
// import * as SentryTracing from "@sentry/tracing"
11+
// Unused named imports are not guaranteed to patch the global hub.
812

913
Sentry.init({
1014
dsn: "___PUBLIC_DSN___",
@@ -19,7 +23,7 @@ Sentry.init({
1923
const Sentry = require("@sentry/node");
2024

2125
// Importing @sentry/tracing patches the global hub for tracing to work.
22-
const Tracing = require("@sentry/tracing");
26+
const SentryTracing = require("@sentry/tracing");
2327

2428
Sentry.init({
2529
dsn: "___PUBLIC_DSN___",

0 commit comments

Comments
 (0)