Skip to content

Commit 1bade0b

Browse files
Fix v6
1 parent 535a133 commit 1bade0b

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

index.html

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,36 @@
7575
</head>
7676

7777
<body>
78-
<div id="root"></div>
78+
<div id="root">
79+
<div
80+
style="display: flex; justify-content: center; align-items: center; height: 100vh; color: white; background-color: #0f172a; font-family: sans-serif; flex-direction: column; gap: 20px;">
81+
<h1>Loading...</h1>
82+
<div id="global-error"
83+
style="color: #ef4444; padding: 20px; background: rgba(0,0,0,0.5); border-radius: 8px; max-width: 80%; display: none; text-align: left; white-space: pre-wrap;">
84+
</div>
85+
</div>
86+
</div>
87+
<script>
88+
window.onerror = function (msg, url, line, col, error) {
89+
const errorDiv = document.getElementById('global-error');
90+
if (errorDiv) {
91+
errorDiv.style.display = 'block';
92+
errorDiv.innerHTML = `<strong>Global Error:</strong> ${msg}<br><small>${url}:${line}:${col}</small><br><br>Stack: ${error ? error.stack : 'N/A'}`;
93+
}
94+
// Also alert to be sure
95+
// alert('Error: ' + msg);
96+
return false;
97+
};
98+
99+
// Catch unhandled promise rejections
100+
window.onunhandledrejection = function (event) {
101+
const errorDiv = document.getElementById('global-error');
102+
if (errorDiv) {
103+
errorDiv.style.display = 'block';
104+
errorDiv.innerHTML += `<br><br><strong>Unhandled Promise:</strong> ${event.reason}`;
105+
}
106+
};
107+
</script>
79108
<script type="module" src="src/main.jsx"></script>
80109
</body>
81110

0 commit comments

Comments
 (0)