mirror of
https://github.com/hanzoai/id.git
synced 2026-10-30 14:57:39 +00:00
Root cause of the post-cutover white-screen: vite.config.ts is loaded as a
native ESM module where `require` is undefined, so the brandJsonPlugin's
`require.resolve('<pkg>/brand.json')` threw and the silent catch skipped
emitting EVERY brand.json. The SPA then served index.html (HTTP 200,
text/html) for /brand/<pkg>/brand.json, loadBrand did res.json() on HTML,
threw "Unexpected token '<'", and App's catch rendered that error as the
whole page — no login form ever mounted.
- vite.config.ts: build a createRequire(import.meta.url) resolver so the
brand.json subpath resolves under ESM. Build now emits all four
dist/brand/<pkg>/brand.json (verified: @hanzo brand.name = "Hanzo").
- brand.ts: read the response as text and JSON.parse explicitly; on
non-JSON throw a precise diagnostic instead of a cryptic SyntaxError,
and require the "brand" key.
- apps/web 0.1.8 -> 0.1.9.