Skip to content

[Nuxt 4] sentry.client.config.ts should be app/sentry[.client].config.ts #17781

@OrbisK

Description

@OrbisK

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/nuxt

SDK Version

10.15.0

Framework Version

4.1.1

Link to Sentry event

No response

Reproduction Example/SDK Setup

import * as Sentry from '@sentry/nuxt'

const config = useRuntimeConfig()

Sentry.init({
  dsn: config.public.sentry.dsn,
  environment: config.public.sentry.environment,
  release: config.public.sentry.release,
  sendDefaultPii: true,
  integrations: [
    Sentry.replayIntegration(),
  ],
  tracesSampleRate: 0.2,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
  enableLogs: true,
})

Steps to Reproduce

  1. setup @sentry/nuxt
  2. add sentry.client.config.ts
  3. use useRuntimeConfig
  4. IDE is complaining

Expected Result

types should work

Actual Result

Vue: Cannot find name useRuntimeConfig

Additional Context

With nuxt 4 most of the client code was moved to /app. The runtimeConfig type does not work outside of /app.

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

Labels

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions