Skip to content

Conversation

n3rdc4ptn
Copy link
Member

@n3rdc4ptn n3rdc4ptn commented Sep 4, 2025

What this PR does / why we need it:
Fixes the sentry implementation to work again in production builds.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
Introduces tsx instead of ts-node which is working with the new configuration in dev setup.

@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 06:46
Copilot

This comment was marked as outdated.

@n3rdc4ptn n3rdc4ptn marked this pull request as draft September 4, 2025 07:39
@n3rdc4ptn n3rdc4ptn changed the title fix(discussable): added unsafe eval to script src fix(sentry): sentry information now coming from bff Sep 5, 2025
@n3rdc4ptn n3rdc4ptn requested a review from Copilot September 5, 2025 11:17
@n3rdc4ptn n3rdc4ptn marked this pull request as ready for review September 5, 2025 11:17
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates Sentry configuration from build-time environment variables to runtime server configuration, enabling proper Sentry functionality in production builds. It also modernizes the development tooling by replacing ts-node with tsx.

  • Updates Sentry configuration to fetch from BFF endpoint instead of build-time variables
  • Replaces ts-node with tsx for improved development setup compatibility
  • Adjusts Content Security Policy to support Sentry's runtime requirements

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vite.config.js Adds telemetry disable flag and ESNext target for top-level await support
src/mount.ts Implements runtime Sentry config fetching from /sentry endpoint
server/config/env.ts Renames environment variables from VITE_* to FRONTEND_* prefix
server.ts Adds /sentry endpoint and updates CSP to allow Sentry scripts
package.json Replaces ts-node with tsx and restructures build scripts
.env.template Updates environment variable names to match new naming convention

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@andreaskienle andreaskienle left a comment

Choose a reason for hiding this comment

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

Nice! Good catch! 👍

In server.ts, there is still one usage of the old VITE_SENTRY_ENVIRONMENT variable. Apart from that: great! ✨

Do we need a separate issue to track the changes to the ui-environments repo?

}

// Validate sentryConfig format
function isValidSentryConfig(config: unknown): config is SentryConfig {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 👍

@n3rdc4ptn n3rdc4ptn merged commit 21b789f into main Sep 8, 2025
5 checks passed
@n3rdc4ptn n3rdc4ptn deleted the sentry-fix branch September 8, 2025 07:18
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.

2 participants