@sentry/nuxt 8.17.0 → 8.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,18 +28,30 @@ The minimum supported version of Nuxt is `3.0.0`.
28
28
  This package is a wrapper around `@sentry/node` for the server and `@sentry/vue` for the client side, with added
29
29
  functionality related to Nuxt.
30
30
 
31
- What is working:
31
+ **What is working:**
32
32
 
33
33
  - Error Reporting
34
+ - Vue
35
+ - Node
36
+ - Nitro
34
37
 
35
- What is partly working:
38
+ **What is partly working:**
36
39
 
37
40
  - Tracing by setting `tracesSampleRate`
41
+ - UI (Vue) traces
42
+ - HTTP (Node) traces
38
43
 
39
- What is not yet(!) included:
44
+ **What is not yet(!) included:**
40
45
 
41
46
  - Source Maps
42
- - Connected Traces
47
+ - Nuxt-specific traces and connecting frontend & backend traces
48
+
49
+ **Known Issues:**
50
+
51
+ - When adding `sentry.server.config.(ts/js)`, you get this error: "Failed to register ESM hook", but the application
52
+ will still work
53
+ - When initializing Sentry on the server with `instrument.server.(js|ts)`, you get an `'import-in-the-middle'` error,
54
+ and the application won't work
43
55
 
44
56
  ## Automatic Setup
45
57
 
@@ -96,10 +108,38 @@ Add a `sentry.server.config.(js|ts)` file to the root of your project:
96
108
  import * as Sentry from '@sentry/nuxt';
97
109
 
98
110
  Sentry.init({
99
- dsn: env.DSN,
111
+ dsn: process.env.DSN,
100
112
  });
101
113
  ```
102
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
+ Add an `instrument.server.mjs` file to your `public` folder:
121
+
122
+ ```javascript
123
+ import * as Sentry from '@sentry/nuxt';
124
+
125
+ // Only run `init` when DSN is available
126
+ if (process.env.SENTRY_DSN) {
127
+ Sentry.init({
128
+ dsn: process.env.DSN,
129
+ });
130
+ }
131
+ ```
132
+
133
+ Add an import flag to the node options, so the file loads before any other imports:
134
+
135
+ ```json
136
+ {
137
+ "scripts": {
138
+ "preview": "NODE_OPTIONS='--import ./public/instrument.server.mjs' nuxt preview"
139
+ }
140
+ }
141
+ ```
142
+
103
143
  ### 5. Vite Setup
104
144
 
105
145
  todo: add vite setup
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "8.17.0",
7
+ "version": "8.18.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.0",
10
10
  "unbuild": "2.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/nuxt",
3
- "version": "8.17.0",
3
+ "version": "8.18.0",
4
4
  "description": "Official Sentry SDK for Nuxt (EXPERIMENTAL)",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/nuxt",
@@ -43,14 +43,14 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@nuxt/kit": "^3.12.2",
46
- "@sentry/browser": "8.17.0",
47
- "@sentry/core": "8.17.0",
48
- "@sentry/node": "8.17.0",
49
- "@sentry/opentelemetry": "8.17.0",
50
- "@sentry/types": "8.17.0",
51
- "@sentry/utils": "8.17.0",
46
+ "@sentry/browser": "8.18.0",
47
+ "@sentry/core": "8.18.0",
48
+ "@sentry/node": "8.18.0",
49
+ "@sentry/opentelemetry": "8.18.0",
50
+ "@sentry/types": "8.18.0",
51
+ "@sentry/utils": "8.18.0",
52
52
  "@sentry/vite-plugin": "2.20.1",
53
- "@sentry/vue": "8.17.0"
53
+ "@sentry/vue": "8.18.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@nuxt/module-builder": "0.8.0",