@@ -57,35 +57,34 @@ aid instrumenting them.
5757
5858If ` import-in-the-middle ` encounters problems wrapping a package, you may see
5959syntax errors at runtime or logged errors in your console:
60- ```
60+
61+ ``` logs
6162SyntaxError: 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
6566You can confirm that these errors are caused by ` import-in-the-middle ` by
6667disabling 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}
7071import * as Sentry from " @sentry/node" ;
7172
7273Sentry .init ({
73- dsn: " ___PUBLIC_DSN___" ,
74- registerEsmLoaderHooks: false
74+ registerEsmLoaderHooks: false ,
7575});
7676```
7777
7878If you are starting Sentry via ` --import ` , you can instruct ` import-in-the-middle `
7979to only wrap packages that Sentry specifically instruments. To do this, you can
8080set the ` onlyIncludeInstrumentedModules ` to ` true ` :
8181
82- ``` javascript {tabTitle:ESM} {filename: instrument.mjs}
82+ ``` javascript {tabTitle:ESM} {filename: instrument.mjs} {4-6}
8383import * as Sentry from " @sentry/node" ;
8484
8585Sentry .init ({
86- dsn: " ___PUBLIC_DSN___" ,
8786 registerEsmLoaderHooks: {
88- onlyIncludeInstrumentedModules: true
87+ onlyIncludeInstrumentedModules: true ,
8988 },
9089});
9190```
0 commit comments