import { setCryptoBackend } from '@chat-app/shared/crypto'; import React from 'react'; import ReactDOM from 'react-dom/client'; import { App } from './App'; import { createLibsodiumBackend } from './lib/cryptoBackend'; import { installCrashHandlers } from './lib/crashRecovery'; import { bootstrapI18n } from './lib/i18n'; import './styles/globals.css'; async function boot(): Promise { // Install first so bootstrap errors (crypto backend, i18n) are captured. installCrashHandlers(); bootstrapI18n(); setCryptoBackend(await createLibsodiumBackend()); const rootEl = document.getElementById('root'); if (!rootEl) throw new Error('Root element #root not found'); ReactDOM.createRoot(rootEl).render( , ); } void boot().catch((err: unknown) => { console.error('boot failed', err); const rootEl = document.getElementById('root'); if (rootEl) { rootEl.innerHTML = '
Boot failed. Check the browser console.
'; } });