You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/install/esm.mdx
+29-4Lines changed: 29 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,18 +49,43 @@ NODE_OPTIONS="--import ./instrument.mjs" npm run start
49
49
50
50
We do not support ESM in Node versions before 18.19.0.
51
51
52
-
## Skipping instrumentation
52
+
## Troubleshooting instrumentation
53
53
54
-
By default, all packages are wrapped under the hood by [import-in-the-middle](https://www.npmjs.com/package/import-in-the-middle). If you run into a problem with a package, you can skip instrumentation for it by configuring `registerEsmLoaderHooks` in your `Sentry.init()` config:
54
+
By default, all packages are wrapped under the hood by
55
+
[import-in-the-middle](https://www.npmjs.com/package/import-in-the-middle) to
56
+
aid instrumenting them.
57
+
58
+
If `import-in-the-middle` encounters problems wrapping a package, you may see
59
+
syntax errors at runtime or logged errors in your console:
60
+
```
61
+
SyntaxError: The requested module '...' does not provide an export named '...'
62
+
(node:3368) Error: 'import-in-the-middle' failed to wrap 'file://../../path/to/file.js'
63
+
```
64
+
65
+
You can confirm that these errors are caused by `import-in-the-middle` by
66
+
disabling it by setting `registerEsmLoaderHooks` to false. Note, this will also
0 commit comments