-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nuxt
SDK Version
v9
Framework Version
Nuxt 3.15.1 + Node v22 + [email protected]
Link to Sentry event
No response
Reproduction Example/SDK Setup
import * as Sentry from '@sentry/nuxt';
Sentry.init({
dsn: '***',
// TODO: We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false
});Steps to Reproduce
When using @sentry/nuxt in a backend-only Nuxt project (e.g., an API without a frontend), Sentry does not automatically capture errors, and even manual error capture (Sentry.captureException(error)) does not work.
It seems that Sentry only initializes when the frontend is engaged. The following logs appear when the frontend is accessed:
ℹ ✨ new dependencies optimized: @sentry/nuxt
ℹ ✨ optimized dependencies changed. reloading
However, if there is no frontend interaction, Sentry does not seem to start, and no errors are captured in the backend.
Steps to Reproduce
- Create a Nuxt project with a backend-only API (server/api/ handlers).
- Trigger an error in an API route.
- Observe that no errors are reported to Sentry.
Expected Result
Sentry should initialize and capture errors automatically, even in an API backend-only Nuxt setup.
Manual error capture (Sentry.captureException(error)) should work as expected.
Actual Result
Sentry is not capturing exceptions in an API backend-only Nuxt setup. Even manual error capture (Sentry.captureException(error)) is not working as expected.
Metadata
Metadata
Assignees
Labels
Projects
Status