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
docs(nuxt): Remove beta, add dev mode command, add cloudflare link (#14651)
## DESCRIBE YOUR PR
Nuxt is now out of Beta:
getsentry/sentry-javascript#17400
## IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [ ] None: Not urgent, can wait up to 1 week+
## SLA
- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!
@@ -58,14 +51,35 @@ To test the server side as well, refer to the "Verify" section in the [Manual se
58
51
59
52
</Expandable>
60
53
61
-
To test Sentry on the server side, you first need to build your project since Sentry's server-side monitoring **doesn't work in development mode**.\
62
-
Then run your project and make sure to load Sentry on the server side by explicitly adding it via [`--import`](/platforms/javascript/guides/nuxt/install/cli-import/):
54
+
To test Sentry, you can run your Nuxt application in either production or development mode.
55
+
We **recommend testing in production mode** as it most closely resembles your deployed application's environment.
56
+
57
+
<Alert>
58
+
By default, the SDK will add the server config as `sentry.server.config.mjs` to the build.
59
+
To find the exact path to this file, enable `debug` mode in your Sentry configuration within `nuxt.config.ts`.
60
+
Sentry will then print the exact path during the build process.
61
+
</Alert>
62
+
63
+
### Run in Production Mode (Recommended)
64
+
65
+
After building with `nuxi build`, run your project and make sure to load Sentry on the server side by explicitly adding it via `--import` (read more about this flag in [Installation Methods](/platforms/javascript/guides/nuxt/install)).
63
66
64
67
```
65
68
# Start your app after building your project with `nuxi build`
The server config file is generated in the `.nuxt` directory the first time you run `nuxt dev`. If you delete your `.nuxt` directory, you'll need to run `nuxt dev` once without the `NODE_OPTIONS` variable to regenerate it.
75
+
76
+
If you only want to use Sentry on the client-side or only need basic error monitoring on the server side, you can omit the `--import` flag when running your application.
77
+
78
+
```
79
+
# Run the dev server with the --import flag after running `nuxt dev` once (without the flag)
80
+
NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev
81
+
```
82
+
69
83
After building and running your project:
70
84
71
85
1. Open the example page `/sentry-example-page` in your browser. For most Nuxt applications, this will be at localhost.
Copy file name to clipboardExpand all lines: docs/platforms/javascript/guides/nuxt/install/cli-import.mdx
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,11 @@ Check out the guide for using <PlatformLink to="/install/limited-server-tracing"
22
22
23
23
## Initializing Sentry with `--import`
24
24
25
-
By default, the SDK will add the Sentry server config to the build output (typically, `.output/server/sentry.server.config.mjs`).
25
+
By default, the SDK will add the Sentry server config to the build output (typically, `.output/server/sentry.server.config.mjs` or ` ./.nuxt/dev/sentry.server.config.mjs` during development).
26
+
27
+
<Alert>
28
+
To find the exact path to the built Sentry server config file, enable `debug` mode in your Sentry configuration within `nuxt.config.ts`. Sentry will then print the exact path during the build process.
Nuxt uses ES Modules for server-side builds, which requires Sentry to register Node [customization hooks](https://nodejs.org/api/module.html#customization-hooks).
10
8
Those customization hooks need to be registered before the rest of the application.
Add a `sentry.server.config.ts` file to the root of your project and add the following initialization code to it:
140
138
141
139
```javascript {filename:sentry.server.config.ts}
@@ -303,8 +301,34 @@ Then update the test page by including a new button that executes a function to
303
301
</template>
304
302
```
305
303
306
-
Once you have your test code in place, you need to build your project since Sentry's server-side monitoring doesn't work in development mode.
307
-
Then start your app and make sure to load Sentry on the server side by explicitly adding the Sentry server config in the build output via <PlatformLinkto="/install/cli-import">`--import`</PlatformLink>.
304
+
Once you have your test code in place, you can run your Nuxt application in either production or development mode.
305
+
We **recommend testing in production mode** as it most closely resembles your deployed application's environment.
306
+
307
+
<Alert>
308
+
By default, the SDK will add the server config as `sentry.server.config.mjs` to the build.
309
+
To find the exact path to this file, enable `debug` mode in your Sentry configuration within `nuxt.config.ts`.
310
+
Sentry will then print the exact path during the build process.
311
+
</Alert>
312
+
313
+
### Run in Production Mode (Recommended)
314
+
315
+
After building with `nuxi build`, run your project and make sure to load Sentry on the server side by explicitly adding it via `--import` (read more about this flag in [Installation Methods](/platforms/javascript/guides/nuxt/install)).
316
+
317
+
```
318
+
# Start your app after building your project with `nuxi build`
The server config file is generated in the `.nuxt` directory the first time you run `nuxt dev`. If you delete your `.nuxt` directory, you'll need to run `nuxt dev` once without the `NODE_OPTIONS` variable to regenerate it.
325
+
326
+
If you only want to use Sentry on the client-side or only need basic error monitoring on the server side, you can omit the `--import` flag when running your application.
327
+
328
+
```
329
+
# Run the dev server with the --import flag after running `nuxt dev` once (without the flag)
330
+
NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev
0 commit comments