Skip to content

Commit a65e178

Browse files
authored
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!
1 parent 582c8c3 commit a65e178

File tree

4 files changed

+61
-21
lines changed

4 files changed

+61
-21
lines changed

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

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ categories:
88
- server
99
---
1010

11-
<Alert level="warning">
12-
This SDK is currently in **beta**. Beta features are still in progress and may
13-
have bugs. Please reach out on
14-
[GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if
15-
you have any feedback or concerns.
16-
</Alert>
17-
1811
<PlatformContent includePath="getting-started-prerequisites" />
1912

2013
## Step 1: Install
@@ -58,14 +51,35 @@ To test the server side as well, refer to the "Verify" section in the [Manual se
5851

5952
</Expandable>
6053

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)).
6366

6467
```
6568
# Start your app after building your project with `nuxi build`
6669
node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs
6770
```
6871

72+
### Run in Development Mode
73+
74+
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+
6983
After building and running your project:
7084

7185
1. Open the example page `/sentry-example-page` in your browser. For most Nuxt applications, this will be at localhost.

docs/platforms/javascript/guides/nuxt/install/cli-import.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ Check out the guide for using <PlatformLink to="/install/limited-server-tracing"
2222

2323
## Initializing Sentry with `--import`
2424

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.
29+
</Alert>
2630

2731
### 1. Adding `--import` to `node` command
2832

docs/platforms/javascript/guides/nuxt/install/index.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ sidebar_order: 1.5
44
description: "Review our alternate installation methods."
55
---
66

7-
8-
97
Nuxt uses ES Modules for server-side builds, which requires Sentry to register Node [customization hooks](https://nodejs.org/api/module.html#customization-hooks).
108
Those customization hooks need to be registered before the rest of the application.
119

docs/platforms/javascript/guides/nuxt/manual-setup.mdx

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ description: "Learn how to manually set up Sentry in your Nuxt app and capture y
99
installer](/platforms/javascript/guides/nuxt).
1010
</Alert>
1111

12-
<Alert level="warning">
13-
This SDK is currently in **beta**. Beta features are still in progress and may
14-
have bugs. Please reach out on
15-
[GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if
16-
you have any feedback or concerns.
17-
</Alert>
18-
1912
<PlatformContent includePath="getting-started-prerequisites" />
2013

2114
## Step 1: Install
@@ -136,6 +129,11 @@ This allows you to access the DSN using `useRuntimeConfig().public.sentry.dsn`.
136129

137130
### Configure Server-side Sentry
138131

132+
<Alert>
133+
Are you deploying to Cloudflare? Continue with the [Cloudflare-specific
134+
setup](/platforms/javascript/guides/cloudflare/frameworks/nuxt/#setup).
135+
</Alert>
136+
139137
Add a `sentry.server.config.ts` file to the root of your project and add the following initialization code to it:
140138

141139
```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
303301
</template>
304302
```
305303

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 <PlatformLink to="/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`
319+
node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs
320+
```
321+
322+
### Run in Development Mode
323+
324+
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
331+
```
308332

309333
After running your project:
310334

0 commit comments

Comments
 (0)