Skip to content

fix(ui): hall boot crash, hydration clock, 404 page - #64

Merged
jasandroidx merged 4 commits into
ravenstackfrom
jules/keep-hall-perf
Sep 21, 2026
Merged

jasandroidx merged 4 commits into
ravenstackfrom
jules/keep-hall-perf

Conversation

@jasandroidx

Copy link
Copy Markdown
Owner

What

Kills the two boot-time errors measured on the live Keep and prettifies 404s. Stacked on the A1 board branch.

Fixes (all verified live on the box with headless Chromium)

  • Hall boot crash — TypeError: Cannot read properties of undefined (reading 'setTint') at scene.ts every page load on /.
    • HallScene.ready is set at the end of create(); keep-hall.tsx now waits for scene.ready (retries up to ~12s) before restoreSeals / setTruthState / quarantine-flare, instead of racing Phaser's async boot.
    • setTruthState null-guards objects that don't exist until boot.
  • SSR hydration mismatch on /duty — removed the SSR-rendered HH:mm:ss clock (server/client copies can never match).
  • Unknown routes — notFoundComponent on __root: custom "This path is not in the keep" page instead of TanStack's bare <p>Not Found</p>.
  • Dev deps experiment reverted — a custom optimizeDeps.include (incl. @tanstack/react-start) broke client boot (AsyncLocalStorage is not a constructor); TanStack Start's plugin manages its own list. Nothing custom is kept; only allowedHosts remains.

Verified live (headless Chromium, on the box)

  • /: canvas renders (1280x663), zero console/page errors (previously: setTint crash).
  • /duty: zero errors, board paints client-side (Workplaces grid, Duty roster, @raziel row).
  • /nonexistent: custom 404 page.
  • vite build exit 0.

Not done here

Serving the production build instead of vite dev is still open (needs a runnable self-host preset — the vercel output isn't locally previewable) and remains the main lever for the ~12MB dev-mode payload on the hall.

Jules Keep added 4 commits September 21, 2026 06:33
- scene.ts: add HallScene.ready set at the end of create() and null-guard
  setTruthState for objects that don't exist until the scene finished
  booting. React held a scene ref the moment the bridge existed, then called
  setTruthState before create() assigned oracleEye/oracleGlow — the boot
  crash (TypeError: ... 'setTint') everyone hit on the hall.
- keep-hall.tsx: restoreSeals + quarantine effects now wait for scene.ready
  (retry window up to ~12s) instead of racing create().
- duty.tsx: drop the SSR-rendered HH:mm:ss clock, which could never match
  hydration and forced a React tree mismatch on every board load.
- __root.tsx: add notFoundComponent so unknown routes stop rendering TanStack's
  bare '<p>Not Found</p>'.
- vite.config.ts: optimizeDeps.include the heavy client stack (react,
  react-dom, router, start, query, sonner, better-auth) so a fresh page load
  doesn't compile the whole graph on first request.

Live-measured (headless Chromium on the box): first load was ~12-13.5MB of
raw JS across 110-220 module requests; the optimizer prebundling plus the
ready-gate removes the crash and the hydration re-render, and cuts the
request path substantially on cool starts.
Forcing @tanstack/react-start into the pre-bundled deps pulls
node:async_hooks into the browser (AsyncLocalStorage shim isn't a
constructor), crashing every client page. TanStack Start's plugin manages
its own opt-in list; a custom replace-list overrides it. Keep only the
allowedHosts addition.
…erver)

The box serves the app directly from .output/server/index.mjs instead of
vite dev. 'build:box' builds the runnable server; plain 'build' keeps the
vercel deploy contract.
@jasandroidx
jasandroidx changed the base branch from jules/keep-live-duty-panel to ravenstack September 21, 2026 07:22
@jasandroidx
jasandroidx merged commit 88c2183 into ravenstack Sep 21, 2026
jasandroidx added a commit that referenced this pull request Sep 21, 2026
Co-authored-by: jasandroidx <77057656+jasandroidx@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant