Conversation
…om Vite dependency optimization.
…enabling Sentry and source map uploads.
| const dsn = env.PUBLIC_SENTRY_DSN || ''; | ||
|
|
||
| Sentry.init({ | ||
| dsn, |
There was a problem hiding this comment.
'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
|
||
| Sentry.init({ | ||
| dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144', | ||
| const dsn = env.PUBLIC_SENTRY_DSN || ''; |
There was a problem hiding this comment.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| @@ -1,29 +1,18 @@ | |||
| import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit"; | |||
| import * as Sentry from '@sentry/sveltekit'; | |||
| import { env } from '$env/dynamic/public'; | |||
There was a problem hiding this comment.
'import' is only available in ES6 (use 'esversion: 6').
| const dsn = env.PUBLIC_SENTRY_DSN || ''; | ||
|
|
||
| Sentry.init({ | ||
| dsn, |
There was a problem hiding this comment.
'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
|
||
| Sentry.init({ | ||
| dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144', | ||
| const dsn = env.PUBLIC_SENTRY_DSN || ''; |
There was a problem hiding this comment.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| @@ -1,13 +1,11 @@ | |||
| import * as Sentry from '@sentry/sveltekit'; | |||
| import { env } from '$env/dynamic/public'; | |||
There was a problem hiding this comment.
'import' is only available in ES6 (use 'esversion: 6').
| const dsn = env.PUBLIC_SENTRY_DSN || ''; | ||
|
|
||
| Sentry.init({ | ||
| dsn, |
There was a problem hiding this comment.
'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
|
||
| Sentry.init({ | ||
| dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144', | ||
| const dsn = env.PUBLIC_SENTRY_DSN || ''; |
There was a problem hiding this comment.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| @@ -1,29 +1,18 @@ | |||
| import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit"; | |||
| import * as Sentry from '@sentry/sveltekit'; | |||
| import { env } from '$env/dynamic/public'; | |||
There was a problem hiding this comment.
'import' is only available in ES6 (use 'esversion: 6').
| const dsn = env.PUBLIC_SENTRY_DSN || ''; | ||
|
|
||
| Sentry.init({ | ||
| dsn, |
There was a problem hiding this comment.
'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
|
||
| Sentry.init({ | ||
| dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144', | ||
| const dsn = env.PUBLIC_SENTRY_DSN || ''; |
There was a problem hiding this comment.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| @@ -1,13 +1,11 @@ | |||
| import * as Sentry from '@sentry/sveltekit'; | |||
| import { env } from '$env/dynamic/public'; | |||
There was a problem hiding this comment.
'import' is only available in ES6 (use 'esversion: 6').
| const dsn = env.PUBLIC_SENTRY_DSN || ''; | ||
|
|
||
| Sentry.init({ | ||
| dsn, |
There was a problem hiding this comment.
'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
|
||
| Sentry.init({ | ||
| dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144', | ||
| const dsn = env.PUBLIC_SENTRY_DSN || ''; |
There was a problem hiding this comment.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| @@ -1,29 +1,18 @@ | |||
| import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit"; | |||
| import * as Sentry from '@sentry/sveltekit'; | |||
| import { env } from '$env/dynamic/public'; | |||
There was a problem hiding this comment.
'import' is only available in ES6 (use 'esversion: 6').
| const dsn = env.PUBLIC_SENTRY_DSN || ''; | ||
|
|
||
| Sentry.init({ | ||
| dsn, |
There was a problem hiding this comment.
'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
|
|
||
| Sentry.init({ | ||
| dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144', | ||
| const dsn = env.PUBLIC_SENTRY_DSN || ''; |
There was a problem hiding this comment.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
| @@ -1,13 +1,11 @@ | |||
| import * as Sentry from '@sentry/sveltekit'; | |||
| import { env } from '$env/dynamic/public'; | |||
There was a problem hiding this comment.
'import' is only available in ES6 (use 'esversion: 6').
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe PR modifies the SvelteKit frontend's Sentry integration to use environment-based DSN configuration instead of hardcoded values. Sentry is now conditionally initialized only when the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR refactors Sentry configuration to use environment variables instead of hardcoded values, improving security and configurability across development and production environments. The changes make Sentry optional by conditionally enabling it based on whether the PUBLIC_SENTRY_DSN environment variable is set.
Changes:
- Removed hardcoded Sentry DSN and replaced with configurable PUBLIC_SENTRY_DSN environment variable
- Added conditional Sentry enablement that only activates when DSN is provided
- Configured automatic version polling (60s) for better deployment tracking
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/vite.config.js | Added autoUploadSourceMaps configuration based on DSN presence; added esm-env to optimizeDeps exclusion |
| frontend/svelte.config.js | Added version polling configuration with 60-second interval for automatic version detection |
| frontend/src/instrumentation.server.js | Replaced hardcoded DSN with environment variable; added conditional enablement; removed verbose comments |
| frontend/src/hooks.client.js | Replaced hardcoded DSN with environment variable; added conditional enablement; removed verbose comments |
| frontend/.env.example | Added documentation for PUBLIC_SENTRY_DSN environment variable with usage instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary by CodeRabbit