Files
FarmaFinder/apps/frontend/src/main.jsx
T
Antoni Nuñez Romeu 6612c8b10c
Run Tests on Branches / Detect Changes (push) Successful in 8s
Run Tests on Branches / Backend Tests (push) Has been skipped
Run Tests on Branches / Frontend Tests (push) Successful in 1m46s
Run Tests on Branches / Frontend Mobile Tests (push) Has been cancelled
Faro & grafana improvements
2026-07-07 23:40:04 +02:00

31 lines
891 B
React

import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import ErrorBoundary from './components/ErrorBoundary';
import './index.css';
import { initNativeShell } from './utils/native';
import { initFaro } from './utils/faro';
// Initialize Grafana Faro (browser RUM) before rendering.
// No-op if VITE_FARO_ENDPOINT is not configured.
initFaro();
// Global unhandled promise rejection handler — report to Faro
window.addEventListener('unhandledrejection', (event) => {
console.warn('[unhandledrejection]', event.reason);
try {
window.__faro?.api?.pushError(event.reason, { type: 'unhandled-rejection' });
} catch { /* Faro must never break the app */ }
});
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<ErrorBoundary>
<App />
</ErrorBoundary>
</React.StrictMode>
);
initNativeShell();