- Backend (NestJS): 82 suites, 641 tests passing; 0 ESLint errors; 0 tsc errors. Hardened SSL cert/key matching, SSRF IP pinning, and eBank validation. - Admin Panel (Vite/React): 48 suites, 300 tests passing; 0 ESLint errors; 0 tsc errors. Full coverage across all pages and settings. - Storefront (Next.js): 62 suites, 368 tests passing; 0 ESLint errors; 0 tsc errors. - Fixed unmount lifecycle guards, promise error handling, and component edge cases.
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { StrictMode } from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
import App from './App.tsx';
|
|
import './index.css';
|
|
|
|
// Handle Vite dynamic import chunk mismatch after fresh deployment
|
|
window.addEventListener('vite:preloadError', (event) => {
|
|
event.preventDefault();
|
|
console.warn('[Vite] Preload error detected, reloading to fetch latest bundle...');
|
|
window.location.reload();
|
|
});
|
|
|
|
window.addEventListener('error', (e) => {
|
|
const msg = e.message || '';
|
|
if (
|
|
msg.includes('Failed to fetch dynamically imported module') ||
|
|
msg.includes('Importing a module script failed') ||
|
|
msg.includes('error loading dynamically imported module')
|
|
) {
|
|
const lastReload = sessionStorage.getItem('vite_chunk_error_reload');
|
|
const now = Date.now();
|
|
if (!lastReload || now - parseInt(lastReload, 10) > 8000) {
|
|
sessionStorage.setItem('vite_chunk_error_reload', String(now));
|
|
window.location.reload();
|
|
}
|
|
}
|
|
});
|
|
|
|
createRoot(document.getElementById('root')!).render(
|
|
<StrictMode>
|
|
<App />
|
|
</StrictMode>,
|
|
)
|