Skip to content

PM-5935: Render a not-found page instead of a blank page for unowned paths - #2187

Open
jmgasper wants to merge 1 commit into
devfrom
PM-5935
Open

PM-5935: Render a not-found page instead of a blank page for unowned paths#2187
jmgasper wants to merge 1 commit into
devfrom
PM-5935

Conversation

@jmgasper

Copy link
Copy Markdown
Collaborator

What was broken

The Topcoder opportunities page showed nothing at all. On
https://topcoder-dev.com/opportunities the Platform UI shell loaded (header, footer,
application container) but the content area stayed empty, and the browser console
reported No routes matched location "/opportunities".

Root cause

The website CloudFront viewer-request function now hands /opportunities and
/opportunities/* on the apex host to the Platform UI origin (topcoder-website commit
"Route opportunities to platform UI"), and the new Opportunities application is still on
the unmerged opportunities-v6 branch (PR #2147). Platform UI therefore serves the
request but has no route registered for that path.

PlatformRouter renders one <Route> per entry in platformRoutes, none of which
matched, so react-router rendered nothing and the user saw a blank page. Platform UI had
no fallback route at all, so the same blank page appeared for any path routed to it that
it does not own.

What was changed

  • Added NotFoundPage under src/apps/platform/src/routes/not-found, reusing the
    existing ContentLayout, PageTitle, IconOutline and LinkButton components and
    mirroring the styling of the existing MemberNotFound page.
  • Registered it in platformRoutes as a route: '*' catch-all, placed last in the list.

React-router ranks the * path lowest, so the fallback cannot shadow any route declared
above it, and routeGetActive never selects it because isActiveTool matches with
startsWith(route.route). On an app subdomain routeMatchAppRouter still replaces
allRoutes with that app's router, so subdomain behaviour is unchanged.

/opportunities now renders a clear "We were unable to find that page" message with a
link home instead of a blank page. Once the Opportunities application merges,
/opportunities matches its own route and the fallback is no longer reached.

Verified against a local yarn build:dev bundle

path before after
/opportunities blank not-found page
/opportunities/detail blank not-found page
/ home route home route (unchanged)
/support, /onboarding owned routes owned routes (unchanged)

Any added/updated tests

Added src/apps/platform/src/routes/not-found/NotFound.spec.tsx, which renders the
platform home and fallback route shapes together and asserts that:

  • /opportunities renders the not-found content with a link to /
  • / still renders the home route, i.e. the catch-all does not shadow an owned route

yarn lint, npx tsc --noEmit and yarn build:dev all pass. yarn test:no-watch
reports 1171 passing tests with 24 failures in 19 suites; the identical 19 suites and 24
tests fail on an unmodified origin/dev checkout, so no new failures are introduced.

🤖 Generated with Claude Code

…paths

What was broken
The Topcoder opportunities page showed nothing at all. On
https://topcoder-dev.com/opportunities the Platform UI shell loaded (header,
footer, application container) but the content area stayed empty, and the
browser console reported `No routes matched location "/opportunities"`.

Root cause
The website CloudFront viewer-request function now hands `/opportunities` and
`/opportunities/*` on the apex host to the Platform UI origin
(topcoder-website commit "Route opportunities to platform UI"), and the new
Opportunities application is still on the unmerged `opportunities-v6` branch
(platform-ui PR #2147). Platform UI therefore serves the request but has no
route registered for that path. `PlatformRouter` renders one `<Route>` per
entry in `platformRoutes`, none of which matched, so react-router rendered
nothing and the user saw a blank page. Platform UI had no fallback route at
all, so the same blank page appeared for any path routed to it that it does
not own.

What was changed
Added a `NotFoundPage` under `src/apps/platform/src/routes/not-found` and
registered it in `platformRoutes` as a `route: '*'` catch-all placed last in
the list. React-router ranks the `*` path lowest, so the fallback cannot
shadow any route declared above it, and `routeGetActive` never selects it
because `isActiveTool` matches with `startsWith(route.route)`. The page reuses
the existing `ContentLayout`, `PageTitle`, `IconOutline` and `LinkButton`
components and mirrors the styling of the existing `MemberNotFound` page.

`/opportunities` now renders a clear "We were unable to find that page"
message with a link home instead of a blank page. Once the Opportunities
application merges, `/opportunities` matches its own route and the fallback is
no longer reached.

Any added/updated tests
Added `src/apps/platform/src/routes/not-found/NotFound.spec.tsx`, which
renders the platform home and fallback route shapes together and asserts that
`/opportunities` renders the not-found content and that `/` still renders the
home route, ie. the catch-all does not shadow an owned route.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jmgasper
jmgasper requested a review from kkartunov as a code owner August 25, 2026 05:17
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