feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
// global-error replaces the root layout: no providers, so it brings the bootstrap, styles and i18n.
|
|
|
|
|
import '../bootstrap/bootstrap.client';
|
|
|
|
|
import '../styles/app.css';
|
|
|
|
|
|
|
|
|
|
import { Element } from '@lumina/island/primitives/element';
|
|
|
|
|
import { ErrorFallback } from '@lumina/market/app/error-boundaries';
|
|
|
|
|
|
|
|
|
|
import { i18n } from '../i18n/i18n.client';
|
|
|
|
|
|
|
|
|
|
type GlobalErrorProps = {
|
|
|
|
|
error: Error & { digest?: string };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** The app boundary (EB-W): the last resort when nothing below caught the error. */
|
|
|
|
|
export default function GlobalError({ error }: GlobalErrorProps) {
|
|
|
|
|
return (
|
2026-10-05 15:00:46 +00:00
|
|
|
<Element tag="html" lang={i18n.language} dir={i18n.dir()}>
|
feat(apps): bootstrap, env, i18n, providers, error pages and session proxy
- env validated with the env lib (NEXT_PUBLIC_API_ORIGIN, API_INTERNAL_ORIGIN,
site URL, support config); .env.example per app
- client bootstrap: API base under /v1, one shared session refresh, error
mapping; server bootstrap: cookie forwarding for server renders
- i18n instance for the server, bound to react-i18next on the client
- root layout, AppProviders, global-error, not-found and a page boundary in
every route group; instrumentation reports uncaught server errors
- proxy.ts refreshes an expired session before rendering
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 17:33:07 +00:00
|
|
|
<Element tag="body">
|
|
|
|
|
<Element tag="meta" name="robots" content="noindex" />
|
|
|
|
|
<ErrorFallback
|
|
|
|
|
error={error}
|
|
|
|
|
size="app"
|
|
|
|
|
onRetry={() => window.location.reload()}
|
|
|
|
|
/>
|
|
|
|
|
</Element>
|
|
|
|
|
</Element>
|
|
|
|
|
);
|
|
|
|
|
}
|