Skip to content

Fix FindPlayersPage runtime crash by reordering bestMatches initialization#123

Open
sahilkashyap64 wants to merge 1 commit into
codex/update-matchplay-find-players-page-uifrom
codex/fix-referenceerror-in-findplayerspage
Open

Fix FindPlayersPage runtime crash by reordering bestMatches initialization#123
sahilkashyap64 wants to merge 1 commit into
codex/update-matchplay-find-players-page-uifrom
codex/fix-referenceerror-in-findplayerspage

Conversation

@sahilkashyap64
Copy link
Copy Markdown
Collaborator

Motivation

  • Prevent a runtime TDZ error caused by bestMatches referencing filteredPlayers before it is defined in src/pages/FindPlayersPage.tsx so the page no longer throws Cannot access '$t' before initialization at runtime.

Description

  • Move the bestMatches useMemo so it is declared after the filteredPlayers useMemo, preserving the original fallback behavior of using players when no filtered results exist and only computing matches when a profile is present.

Testing

  • Ran the production build with npm run build and the build completed successfully.

Codex Task

@github-actions
Copy link
Copy Markdown

PR Preview Action v1.6.2

🚀 View preview at
https://CodeMyMobile.github.io/ttp-player-web/pr-preview/pr-123/

Built to branch gh-pages at 2026-02-12 08:22 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant