diff --git a/assets/js/app.js b/assets/js/app.js index 18cc854..2f35c7b 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -22,23 +22,25 @@ import { Socket } from "phoenix"; import { LiveSocket } from "phoenix_live_view"; import topbar from "../vendor/topbar"; -// Initialize Sentry for JavaScript error tracking -if (typeof window.Sentry !== 'undefined') { - window.Sentry.init({ - dsn: "https://337ece4c07ff53c6719d900adfddd6e4@o4509627566063616.ingest.us.sentry.io/4509691336785920", - environment: process.env.NODE_ENV || "production", - integrations: [ - new window.Sentry.BrowserTracing(), - ], - tracesSampleRate: 1.0, // Capture 100% of transactions for performance monitoring - sampleRate: 1.0, // Capture 100% of errors - beforeSend(event, hint) { - // Filter out known non-critical errors - if (hint.originalException?.message?.includes('ResizeObserver loop limit exceeded')) { - return null; +// Sentry initialization happens via the loader script in the HTML +// Configure additional Sentry settings if needed +if (typeof window.Sentry !== 'undefined' && window.Sentry.onLoad) { + window.Sentry.onLoad(function() { + window.Sentry.init({ + environment: "production", + integrations: [ + new window.Sentry.BrowserTracing(), + ], + tracesSampleRate: 1.0, // Capture 100% of transactions for performance monitoring + sampleRate: 1.0, // Capture 100% of errors + beforeSend(event, hint) { + // Filter out known non-critical errors + if (hint.originalException?.message?.includes('ResizeObserver loop limit exceeded')) { + return null; + } + return event; } - return event; - } + }); }); } diff --git a/lib/aprsme_web/components/layouts/root.html.heex b/lib/aprsme_web/components/layouts/root.html.heex index 222c701..e583c06 100644 --- a/lib/aprsme_web/components/layouts/root.html.heex +++ b/lib/aprsme_web/components/layouts/root.html.heex @@ -64,7 +64,8 @@ -