fix(bootstrap): show the boot error shell when the app graph fails to evaluate (09-03)
A module that threw while evaluating stopped main.tsx before boot() ran, so the static loading shell stayed up. The entry now imports the app (boot.tsx) dynamically and renders the shell on rejection; the shell reads boot messages without the feature catalog. The preload helper gets its own chunk so lazy chunks do not import the per-build entry, and the bundle budget counts the entry's dynamic imports as initial JS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e215c849fb
commit
9c8a5f417a
@@ -0,0 +1,17 @@
|
||||
import { createRoot } from "react-dom/client";
|
||||
|
||||
import { recordBootFailure } from "../adapters/diagnostics/index.ts";
|
||||
import { BootErrorShell } from "../presentation/boundaries/boot-error-shell.tsx";
|
||||
|
||||
/**
|
||||
* 09-03. Renders the boot failure when the application graph (boot.tsx) could
|
||||
* not even be evaluated. Nothing here reaches the installed feature graph, so
|
||||
* it still loads when that graph throws.
|
||||
*/
|
||||
export function renderBootFailure(error: unknown): void {
|
||||
const safe = { supportReference: "boot:unknown" };
|
||||
recordBootFailure(error, safe);
|
||||
const rootElement = document.getElementById("root");
|
||||
if (!rootElement) throw error;
|
||||
createRoot(rootElement).render(<BootErrorShell {...safe} />);
|
||||
}
|
||||
Reference in New Issue
Block a user