global-error.tsx71 lines · main
1'use client';
2
3/**
4 * Root-layout error boundary. This replaces the whole document (the root
5 * layout failed), so globals.css + fonts are NOT available — styles are
6 * inlined so the fallback always renders. Only triggers on catastrophic
7 * root-level errors; segment errors use error.tsx.
8 */
9export default function GlobalError({
10 error,
11 reset,
12}: {
13 error: Error & { digest?: string };
14 reset: () => void;
15}) {
16 return (
17 <html lang="en">
18 <body
19 style={{
20 margin: 0,
21 minHeight: '100dvh',
22 display: 'flex',
23 flexDirection: 'column',
24 alignItems: 'center',
25 justifyContent: 'center',
26 gap: '1rem',
27 background: '#0a0b0d',
28 color: '#e6e6e6',
29 fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',
30 fontSize: '14px',
31 padding: '2rem',
32 textAlign: 'center',
33 }}
34 >
35 <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
36 <img src="/icon.svg" alt="" width={28} height={28} />
37 <span>briven</span>
38 </div>
39 <h1 style={{ fontSize: '1.5rem', margin: 0, letterSpacing: '-0.02em' }}>
40 something broke
41 </h1>
42 <p style={{ color: '#9a9a9a', margin: 0, maxWidth: '32rem' }}>
43 briven hit an unexpected error. it&apos;s been logged. try reloading.
44 </p>
45 {error.digest ? (
46 <p style={{ color: '#6a6a6a', margin: 0, fontSize: '10px' }}>reference: {error.digest}</p>
47 ) : null}
48 <button
49 type="button"
50 onClick={reset}
51 style={{
52 marginTop: '0.5rem',
53 border: '1px solid #2a2c31',
54 background: '#15171a',
55 color: '#e6e6e6',
56 borderRadius: '6px',
57 padding: '0.75rem 1rem',
58 cursor: 'pointer',
59 fontFamily: 'inherit',
60 fontSize: '14px',
61 }}
62 >
63 ↻ reload
64 </button>
65 <footer style={{ marginTop: '2rem', fontSize: '10px', color: '#6a6a6a' }}>
66 built with <span style={{ color: '#e8344a' }}>♥</span> in Flanders · flndrn Limited
67 </footer>
68 </body>
69 </html>
70 );
71}