From 6d161c4ad2d79c8d169c5b484adad275259479ba Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Wed, 13 Aug 2025 13:51:13 +0200 Subject: [PATCH 1/3] docs(nuxt): Remove beta, add dev mode command, add cloudflare link --- .../javascript/guides/nuxt/index.mdx | 26 ++++++++++++------- .../guides/nuxt/install/cli-import.mdx | 6 ++++- .../javascript/guides/nuxt/install/index.mdx | 2 -- .../javascript/guides/nuxt/manual-setup.mdx | 5 ++++ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/docs/platforms/javascript/guides/nuxt/index.mdx b/docs/platforms/javascript/guides/nuxt/index.mdx index 00839f64cad95..1328278757a3b 100644 --- a/docs/platforms/javascript/guides/nuxt/index.mdx +++ b/docs/platforms/javascript/guides/nuxt/index.mdx @@ -8,13 +8,6 @@ categories: - server --- - - This SDK is currently in **beta**. Beta features are still in progress and may - have bugs. Please reach out on - [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if - you have any feedback or concerns. - - ## Step 1: Install @@ -58,14 +51,29 @@ To test the server side as well, refer to the "Verify" section in the [Manual se -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**.\ -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/): +To test Sentry on the server side, you can run your Nuxt application in either production or development mode. +We recommend testing in production mode as it most closely resembles your deployed application's environment. + +### Run in Production Mode (recommended) + +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)) ``` # Start your app after building your project with `nuxi build` node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs ``` +### Run in Development Mode + +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. + +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. + +``` +# Run the dev server with the --import flag after running `nuxt dev` once (without the flag) +NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev +``` + After building and running your project: 1. Open the example page `/sentry-example-page` in your browser. For most Nuxt applications, this will be at localhost. diff --git a/docs/platforms/javascript/guides/nuxt/install/cli-import.mdx b/docs/platforms/javascript/guides/nuxt/install/cli-import.mdx index b5992a562823d..c36bd401a2362 100644 --- a/docs/platforms/javascript/guides/nuxt/install/cli-import.mdx +++ b/docs/platforms/javascript/guides/nuxt/install/cli-import.mdx @@ -22,7 +22,11 @@ Check out the guide for using + 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. + ### 1. Adding `--import` to `node` command diff --git a/docs/platforms/javascript/guides/nuxt/install/index.mdx b/docs/platforms/javascript/guides/nuxt/install/index.mdx index 547a8bda34c89..b9e212e5ae87d 100644 --- a/docs/platforms/javascript/guides/nuxt/install/index.mdx +++ b/docs/platforms/javascript/guides/nuxt/install/index.mdx @@ -4,8 +4,6 @@ sidebar_order: 1.5 description: "Review our alternate installation methods." --- - - Nuxt uses ES Modules for server-side builds, which requires Sentry to register Node [customization hooks](https://nodejs.org/api/module.html#customization-hooks). Those customization hooks need to be registered before the rest of the application. diff --git a/docs/platforms/javascript/guides/nuxt/manual-setup.mdx b/docs/platforms/javascript/guides/nuxt/manual-setup.mdx index 22d0d0ebfd88b..305f3d2417411 100644 --- a/docs/platforms/javascript/guides/nuxt/manual-setup.mdx +++ b/docs/platforms/javascript/guides/nuxt/manual-setup.mdx @@ -136,6 +136,11 @@ This allows you to access the DSN using `useRuntimeConfig().public.sentry.dsn`. ### Configure Server-side Sentry + + Are you deploying to Cloudflare? Continue with the [Cloudflare-specific + setup](/platforms/javascript/guides/cloudflare/frameworks/nuxt/#setup). + + Add a `sentry.server.config.ts` file to the root of your project and add the following initialization code to it: ```javascript {filename:sentry.server.config.ts} From e0cc593fc95aa8d1b125b3bd8173fb0e7835e0bb Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Thu, 14 Aug 2025 16:01:02 +0200 Subject: [PATCH 2/3] review suggestions --- .../javascript/guides/nuxt/index.mdx | 14 ++++++--- .../javascript/guides/nuxt/manual-setup.mdx | 30 +++++++++++++++++-- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/docs/platforms/javascript/guides/nuxt/index.mdx b/docs/platforms/javascript/guides/nuxt/index.mdx index 1328278757a3b..d2d5c9af25d32 100644 --- a/docs/platforms/javascript/guides/nuxt/index.mdx +++ b/docs/platforms/javascript/guides/nuxt/index.mdx @@ -51,12 +51,18 @@ To test the server side as well, refer to the "Verify" section in the [Manual se -To test Sentry on the server side, you can run your Nuxt application in either production or development mode. -We recommend testing in production mode as it most closely resembles your deployed application's environment. +To test Sentry, you can run your Nuxt application in either production or development mode. +We **recommend testing in production mode** as it most closely resembles your deployed application's environment. + + + By default, the SDK will add the server config as `sentry.server.config.mjs` to the build. + To find the exact path to this file, enable `debug` mode in your Sentry configuration within `nuxt.config.ts`. + Sentry will then print the exact path during the build process. + ### Run in Production Mode (recommended) -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)) +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)). ``` # Start your app after building your project with `nuxi build` @@ -67,7 +73,7 @@ node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs 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. -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. +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. ``` # Run the dev server with the --import flag after running `nuxt dev` once (without the flag) diff --git a/docs/platforms/javascript/guides/nuxt/manual-setup.mdx b/docs/platforms/javascript/guides/nuxt/manual-setup.mdx index 305f3d2417411..37f1d1f9d159a 100644 --- a/docs/platforms/javascript/guides/nuxt/manual-setup.mdx +++ b/docs/platforms/javascript/guides/nuxt/manual-setup.mdx @@ -308,8 +308,34 @@ Then update the test page by including a new button that executes a function to ``` -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. -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 `--import`. +Once you have your test code in place, you can run your Nuxt application in either production or development mode. +We **recommend testing in production mode** as it most closely resembles your deployed application's environment. + + + By default, the SDK will add the server config as `sentry.server.config.mjs` to the build. + To find the exact path to this file, enable `debug` mode in your Sentry configuration within `nuxt.config.ts`. + Sentry will then print the exact path during the build process. + + +### Run in Production Mode (recommended) + +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)). + +``` +# Start your app after building your project with `nuxi build` +node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs +``` + +### Run in Development Mode + +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. + +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. + +``` +# Run the dev server with the --import flag after running `nuxt dev` once (without the flag) +NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev +``` After running your project: From baeb28725833afa038a119bebb6ca769921fa799 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Thu, 14 Aug 2025 17:17:16 +0200 Subject: [PATCH 3/3] Delete alert from manual page --- docs/platforms/javascript/guides/nuxt/index.mdx | 2 +- docs/platforms/javascript/guides/nuxt/manual-setup.mdx | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/platforms/javascript/guides/nuxt/index.mdx b/docs/platforms/javascript/guides/nuxt/index.mdx index d2d5c9af25d32..a950a2c6df1ab 100644 --- a/docs/platforms/javascript/guides/nuxt/index.mdx +++ b/docs/platforms/javascript/guides/nuxt/index.mdx @@ -60,7 +60,7 @@ We **recommend testing in production mode** as it most closely resembles your de Sentry will then print the exact path during the build process. -### Run in Production Mode (recommended) +### Run in Production Mode (Recommended) 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)). diff --git a/docs/platforms/javascript/guides/nuxt/manual-setup.mdx b/docs/platforms/javascript/guides/nuxt/manual-setup.mdx index 37f1d1f9d159a..be7f1ede11d2b 100644 --- a/docs/platforms/javascript/guides/nuxt/manual-setup.mdx +++ b/docs/platforms/javascript/guides/nuxt/manual-setup.mdx @@ -9,13 +9,6 @@ description: "Learn how to manually set up Sentry in your Nuxt app and capture y installer](/platforms/javascript/guides/nuxt). - - This SDK is currently in **beta**. Beta features are still in progress and may - have bugs. Please reach out on - [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if - you have any feedback or concerns. - - ## Step 1: Install @@ -317,7 +310,7 @@ We **recommend testing in production mode** as it most closely resembles your de Sentry will then print the exact path during the build process. -### Run in Production Mode (recommended) +### Run in Production Mode (Recommended) 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)).