Skip to content

Commit fcca568

Browse files
Update Bun and Node.js docs with warning about early Sentry initialization
Co-authored-by: paul.jaffre <[email protected]>
1 parent 2d02c50 commit fcca568

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/platforms/javascript/guides/bun/index.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ You can also manually capture performance data - see <PlatformLink to="/tracing/
6464

6565
## Use
6666

67-
You need to import the `instrument.js` file before importing any other modules in your application. This is necessary to ensure that Sentry can automatically instrument all modules in your application:
67+
<Alert level='warning'>
68+
69+
Import `instrument.js` before any other modules to ensure Sentry initializes early. If you initialize later, auto-instrumentation and modules like database monitoring, agent monitoring, tracing may not work.
70+
71+
</Alert>
6872

6973
```javascript {filename: app.js}
7074
// Import this first!

platform-includes/getting-started-node/javascript.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ To import and initialize Sentry, create a file named `instrument.(js|mjs)` in th
2626

2727
### Apply Instrumentation to Your App
2828

29-
Make sure to initialize Sentry before you require or import any other modules in your app. Otherwise, auto-instrumentation won't work for these modules.
29+
<Alert level='warning'>
30+
31+
Import `instrument.js` before any other modules to ensure Sentry initializes early. If you initialize later, auto-instrumentation and modules like database monitoring, agent monitoring, tracing may not work.
32+
33+
</Alert>
3034

3135
<Alert level="info" title="Which module system are you using?">
3236

0 commit comments

Comments
 (0)