File tree Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -102,21 +102,6 @@ Sentry.init({
102102
103103### 4. Server-side setup
104104
105- Add a ` sentry.server.config.(js|ts) ` file to the root of your project:
106-
107- ``` javascript
108- import * as Sentry from ' @sentry/nuxt' ;
109-
110- Sentry .init ({
111- dsn: process .env .DSN ,
112- });
113- ```
114-
115- ** Alternative Setup (ESM-compatible)**
116-
117- This setup makes sure Sentry is imported on the server before any other imports. As of now, this however leads to an
118- import-in-the-middle error ([ related reproduction] ( https://github.com/getsentry/sentry-javascript-examples/pull/38 ) ).
119-
120105Add an ` instrument.server.mjs ` file to your ` public ` folder:
121106
122107``` javascript
@@ -130,7 +115,8 @@ if (process.env.SENTRY_DSN) {
130115}
131116```
132117
133- Add an import flag to the node options, so the file loads before any other imports:
118+ Add an import flag to the ` NODE_OPTIONS ` of your preview script in the ` package.json ` file, so the file loads before any
119+ other imports:
134120
135121``` json
136122{
@@ -140,6 +126,18 @@ Add an import flag to the node options, so the file loads before any other impor
140126}
141127```
142128
129+ If you are getting an ` import-in-the-middle ` error message, add the package with a minimum version of ` 1.10.0 ` as a
130+ dependency to your ` package.json `
131+ ([ issue reference] ( https://github.com/getsentry/sentry-javascript-examples/pull/38#issuecomment-2245259327 ) ):
132+
133+ ``` json
134+ {
135+ "dependencies" : {
136+ "import-in-the-middle" : " 1.10.0"
137+ }
138+ }
139+ ```
140+
143141### 5. Vite Setup
144142
145143todo: add vite setup
You can’t perform that action at this time.
0 commit comments