Docs 404 experience
2026-09-18
Unknown URLs on docs.dreamlake.ai used to answer with the homepage and HTTP
200: netlify.toml carried a /* -> /index.html 200 SPA catch-all, a
leftover from before the site was fully prerendered. Broken links looked
healthy to crawlers and link checkers, and the reader who followed one got a
silent redirect-to-home. The pages/_error/+Page.tsx placeholder (a bare
centered "404") existed but nothing served it.
This change makes the error page a first-class docs page and fixes the status code:
- Status code. The catch-all in
netlify.tomlis now/* -> /404.html 404. Vike already prerenderspages/_errortodist/client/404.html; the rule is notforced, so every existing file (pages,.mdtwins, pagefind, images) still wins, and the_redirects301s are processed first as before. - The page. Rewritten to render like a docs page inside the normal
dockit shell (topbar, sidebar, theme): an
HTTP 404mono kicker, the standard H1/lede typography, the requested path echoed back (filled in after hydration — the prerendered HTML is built for the placeholder/404URL), a ⌘K search hint, aCardGridof the main destinations (overview, CLI, workflows, Lakeshore, API, cli.dreamlake.ai), and an open-an-issue escape hatch. - 404 vs 500. The component reads Vike's
is404page prop and shows a "Something went wrong / reload" variant for render errors;undefinedis treated as 404 since static hosting only reaches the page for missing paths. - Search hygiene. The error page carries
data-pagefind-ignore— the Layout marks every page's<main>indexable and the page has no frontmatter to saynoindex, so it was being indexed (pagefind page count drops 71 → 70 with content words back to baseline).
Validation: full pnpm build passes; netlify dev --offline against
dist/client (which applies netlify.toml and _redirects semantics)
returns 200 for /, /cli, /cli/, /lakeshore/, /release-notes/,
/index.md, /llms.txt and /pagefind/pagefind-entry.json, 301 for the
legacy /hosts/enroll, and 404 with the new page body for
/this-page-does-not-exist and /cli/nope. Playwright screenshots verify
the page in light and dark themes with the requested path hydrated in, and
the homepage rendering unchanged.
Remaining: live verification after the next pnpm deploy (curl an unknown
path on docs.dreamlake.ai for status 404 + page body, and the homepage for 200) — recorded on the PR.