Skip to content

Commit d561fa7

Browse files
author
Luca Forstner
committed
cleanup
1 parent 19142c2 commit d561fa7

File tree

1 file changed

+7
-8
lines changed
  • docs/platforms/javascript/common/install

1 file changed

+7
-8
lines changed

docs/platforms/javascript/common/install/esm.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,35 +57,34 @@ aid instrumenting them.
5757

5858
If `import-in-the-middle` encounters problems wrapping a package, you may see
5959
syntax errors at runtime or logged errors in your console:
60-
```
60+
61+
```logs
6162
SyntaxError: The requested module '...' does not provide an export named '...'
6263
(node:3368) Error: 'import-in-the-middle' failed to wrap 'file://../../path/to/file.js'
6364
```
6465

6566
You can confirm that these errors are caused by `import-in-the-middle` by
6667
disabling it by setting `registerEsmLoaderHooks` to false. Note, this will also
67-
disable tracing instrumentation:
68+
disable tracing instrumentation:
6869

69-
```javascript {tabTitle:ESM} {filename: instrument.mjs}
70+
```javascript {tabTitle:ESM} {filename: instrument.mjs} {4}
7071
import * as Sentry from "@sentry/node";
7172

7273
Sentry.init({
73-
dsn: "___PUBLIC_DSN___",
74-
registerEsmLoaderHooks: false
74+
registerEsmLoaderHooks: false,
7575
});
7676
```
7777

7878
If you are starting Sentry via `--import`, you can instruct `import-in-the-middle`
7979
to only wrap packages that Sentry specifically instruments. To do this, you can
8080
set the `onlyIncludeInstrumentedModules` to `true`:
8181

82-
```javascript {tabTitle:ESM} {filename: instrument.mjs}
82+
```javascript {tabTitle:ESM} {filename: instrument.mjs} {4-6}
8383
import * as Sentry from "@sentry/node";
8484

8585
Sentry.init({
86-
dsn: "___PUBLIC_DSN___",
8786
registerEsmLoaderHooks: {
88-
onlyIncludeInstrumentedModules: true
87+
onlyIncludeInstrumentedModules: true,
8988
},
9089
});
9190
```

0 commit comments

Comments
 (0)