Skip to content

Sveltekit Sentry handler clobbers error messages in dev #15428

@divmgl

Description

@divmgl

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/svelte

SDK Version

"@sentry/sveltekit": "^8",

Framework Version

Svelte 5

Link to Sentry event

No response

Reproduction Example/SDK Setup

Instrumenting Sveltekit results in error messages being clobbered in local dev. This means that I have to deploy different versions of my codebase to production than what's in development, which is not ideal. This happens even if Sentry is not enabled:

Sentry.init({
  dsn: /** DSN omitted */
  tracesSampleRate: 1,
  enabled: import.meta.env.PROD,
  environment: import.meta.env.PROD ? "prod" : "dev",
})


export const handle: Handle = sequence(Sentry.sentryHandle(), sequence(supabase, authGuard))
export const handleError = Sentry.handleErrorWithSentry()

Any error occurs on a +page.server.ts module, undefined gets printed to console rather than the actual error. It's happening with every error.

Steps to Reproduce

export const handle: Handle = sequence(Sentry.sentryHandle(), sequence(supabase, authGuard))
export const handleError = Sentry.handleErrorWithSentry()

Expected Result

Image

Actual Result

Image

Metadata

Metadata

Assignees

Projects

Status

Waiting for: Community

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions