Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
The Topcoder opportunities page showed nothing at all. On
https://topcoder-dev.com/opportunitiesthe 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
/opportunitiesand/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-v6branch (PR #2147). Platform UI therefore serves therequest but has no route registered for that path.
PlatformRouterrenders one<Route>per entry inplatformRoutes, none of whichmatched, 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
NotFoundPageundersrc/apps/platform/src/routes/not-found, reusing theexisting
ContentLayout,PageTitle,IconOutlineandLinkButtoncomponents andmirroring the styling of the existing
MemberNotFoundpage.platformRoutesas aroute: '*'catch-all, placed last in the list.React-router ranks the
*path lowest, so the fallback cannot shadow any route declaredabove it, and
routeGetActivenever selects it becauseisActiveToolmatches withstartsWith(route.route). On an app subdomainrouteMatchAppRouterstill replacesallRouteswith that app's router, so subdomain behaviour is unchanged./opportunitiesnow renders a clear "We were unable to find that page" message with alink home instead of a blank page. Once the Opportunities application merges,
/opportunitiesmatches its own route and the fallback is no longer reached.Verified against a local
yarn build:devbundle/opportunities/opportunities/detail//support,/onboardingAny added/updated tests
Added
src/apps/platform/src/routes/not-found/NotFound.spec.tsx, which renders theplatform home and fallback route shapes together and asserts that:
/opportunitiesrenders the not-found content with a link to//still renders the home route, i.e. the catch-all does not shadow an owned routeyarn lint,npx tsc --noEmitandyarn build:devall pass.yarn test:no-watchreports 1171 passing tests with 24 failures in 19 suites; the identical 19 suites and 24
tests fail on an unmodified
origin/devcheckout, so no new failures are introduced.🤖 Generated with Claude Code