Files
jobtrackingapp/job-tracker-ui/app/[[...slug]]/page.tsx
T
cesnimda 585047da9e
CI and Deploy / test (push) Failing after 1m55s
CI and Deploy / deploy (push) Has been skipped
fix(career): public CV deep links work on direct load, refresh, and shared links
Phase 4.5 (priority 4). The app is a React Router SPA behind Next static
export, which only generated `/` — so a hard load of any deep path (/cv/{slug},
/login, /career/builder/…) hit Next's client not-found before React Router
could route it. Replace the single app/page.tsx with an optional catch-all
app/[[...slug]] (server page + client shell so generateStaticParams stays
server-only) that matches every path; nginx already serves index.html for
unknown paths (try_files), so React Router now owns routing on direct load.

Also: PublicCvPage shows a friendly 404 empty state and sets the document
title. Verified live — /login and /cv/{slug} both resolve on direct navigation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 10:34:56 +02:00

16 lines
739 B
TypeScript

import ClientShell from "./ClientShell";
// Optional catch-all so EVERY path (/, /cv/{slug}, /career/builder/…) resolves to this same shell on
// a hard load. Without it, `output: export` only generates `/`, and Next's client renders its
// not-found for any deep URL before React Router can route it — breaking refresh and shared links.
// generateStaticParams emits just index.html (the empty slug); nginx (try_files $uri /index.html)
// serves that shell for every unknown path, and this catch-all matches it client-side so React
// Router takes over. See docs/architecture/frontend.md (SPA routing).
export function generateStaticParams() {
return [{ slug: [] }];
}
export default function Page() {
return <ClientShell />;
}