fix(config): ensure analytics URL has protocol to prevent build crash
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 38s
Build & Deploy / 🧪 QA (push) Successful in 1m22s
Build & Deploy / 🏗️ Build (push) Successful in 4m27s
Build & Deploy / 🚀 Deploy (push) Failing after 39s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-05-12 13:01:18 +02:00
parent 5d3be82d8f
commit 26d325df44
32998 changed files with 7245 additions and 3832721 deletions

View File

@@ -56,8 +56,15 @@ const nextConfig = {
// Rewrites moved to bottom merged function
async headers() {
const isProd = process.env.NODE_ENV === 'production';
const umamiDomain = new URL(process.env.UMAMI_API_ENDPOINT || 'https://analytics.infra.mintel.me').origin;
const glitchtipDomain = new URL(process.env.SENTRY_DSN ? new URL(process.env.SENTRY_DSN).origin : 'https://errors.infra.mintel.me').origin;
// Ensure API endpoints have a protocol to avoid 'Invalid URL' errors during build
let umamiUrl = process.env.UMAMI_API_ENDPOINT || 'https://analytics.infra.mintel.me';
if (umamiUrl && !umamiUrl.startsWith('http')) umamiUrl = `https://${umamiUrl}`;
const umamiDomain = new URL(umamiUrl).origin;
let glitchtipUrl = process.env.SENTRY_DSN ? new URL(process.env.SENTRY_DSN).origin : 'https://errors.infra.mintel.me';
if (glitchtipUrl && !glitchtipUrl.startsWith('http')) glitchtipUrl = `https://${glitchtipUrl}`;
const glitchtipDomain = new URL(glitchtipUrl).origin;
const extraImgDomains = [
'https://e-tib.com',
'https://staging.e-tib.com',