Skip to content

feat(nuxt): Enable server-side Sentry during nuxt dev on Nitro v3 (Nuxt 5) - #23644

Open
s1gr1d wants to merge 2 commits into
developfrom
sig/nuxt-dev-mode
Open

feat(nuxt): Enable server-side Sentry during nuxt dev on Nitro v3 (Nuxt 5)#23644
s1gr1d wants to merge 2 commits into
developfrom
sig/nuxt-dev-mode

Conversation

@s1gr1d

@s1gr1d s1gr1d commented Aug 26, 2026

Copy link
Copy Markdown
Member

Server-side Sentry did not work in nuxt dev on Nuxt 5. The SDK generates .nuxt/dev/sentry.server.config.mjs for users to preload with node --import, and on Nitro v3 that file was never created.

Nitro v3 serves the dev server through Vite's module runner instead of bundling it, so there is no build output to emit into.

For Nitro v3, the file is written as a Nuxt template instead of a Rollup artifact. This can be done because Nuxt requires Node 22.19 or later (which allows .ts).

Nitro v2 (Nuxt v4) keeps the existing path untouched.

Needed for the E2E test: #22017

@s1gr1d
s1gr1d requested a review from a team as a code owner August 26, 2026 11:24
@s1gr1d
s1gr1d requested review from mydea and nicohrubec and removed request for a team August 26, 2026 11:24
@s1gr1d s1gr1d changed the title feat(nuxt): Enable server-side Sentry during nuxt dev on Nitro v3 feat(nuxt): Enable server-side Sentry during nuxt dev on Nitro v3 (Nuxt 5) Aug 26, 2026
@s1gr1d
s1gr1d requested a review from chargome August 26, 2026 11:25
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.58 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.6 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.51 kB - -
@sentry/browser (incl. Tracing, Replay) 88.06 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.46 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.76 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.47 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.46 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.31 kB - -
@sentry/react (incl. Tracing) 50.79 kB - -
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.82 kB - -
@sentry/svelte 28.59 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.07 kB - -
CDN Bundle (incl. Logs, Metrics) 32.56 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.95 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73 kB - -
CDN Bundle (incl. Tracing, Replay) 86.58 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.46 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.34 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.27 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.69 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.38 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.42 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.18 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.86 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.88 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.55 kB - -
@sentry/nextjs (client) 53.33 kB - -
@sentry/sveltekit (client) 49.03 kB - -
@sentry/core/server 65.19 kB - -
@sentry/core/browser 52.35 kB - -
@sentry/node 122.66 kB +0.02% +19 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.22 kB - -
@sentry/node - without tracing 87.95 kB +0.03% +21 B 🔺
@sentry/aws-serverless 96.14 kB +0.03% +27 B 🔺
@sentry/cloudflare (withSentry) - minified 199.5 kB - -
@sentry/cloudflare (withSentry) 495.46 kB - -

View base workflow run

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

/*! rollup-include-esm-only-end */

// Nitro v3 does not bundle the Sentry server config file, so `import.meta.dev` stays undefined there

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should this comment be above the isDevBuild = !!import.meta.dev line?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't really matter actually 🤔 but this one is more related to isNuxtDevRuntime()

Sentry is set up on the server-side with `sentry.server.config.ts` since
a long time already and this is the first and very old version, which
can be removed.

First merge this:
#23644

Closes #23645
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants