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({
102
102
103
103
### 4. Server-side setup
104
104
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
-
120
105
Add an ` instrument.server.mjs ` file to your ` public ` folder:
121
106
122
107
``` javascript
@@ -130,7 +115,8 @@ if (process.env.SENTRY_DSN) {
130
115
}
131
116
```
132
117
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:
134
120
135
121
``` json
136
122
{
@@ -140,6 +126,18 @@ Add an import flag to the node options, so the file loads before any other impor
140
126
}
141
127
```
142
128
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
+
143
141
### 5. Vite Setup
144
142
145
143
todo: add vite setup
You can’t perform that action at this time.
0 commit comments