Homepage fails to compile: the hero's contributor count references an undefined `platformStats`, and would show the mock value even once it resolves
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- next.js, typescript
- Domain
- frontend
Research direction
Start with src/app/page.tsx, especially the stats resolution at lines 93–116 and the hero contributor line at line 153. Check how the hero and stat cards use the resolved value, then run npx tsc --noEmit to confirm the undefined name is fixed. Done when the homepage compiles and the hero reads from the resolved stats; verify the /analytics/platform contributor field before presenting that number as real.
Written by the indexing model from the issue text.
Description
Location
src/app/page.tsx:153 (import at line 23, live value at lines 93-116)
Problem
The hero's social-proof line reads:
{formatInteger(platformStats.activeContributors)} contributors
There is no binding named platformStats in this module. Line 23 deliberately renames the import:
import {
platformStats as mockPlatformStats,
...
} from "@/lib/mock-data";
platformStats is not declared locally, not a global, and not imported under that name anywhere in the file — grep -n platformStats src/app/page.tsx returns exactly two hits: the aliased import on line 23 and this usage on line 153. The result is TS2304: Cannot find name 'platformStats', so tsc --noEmit and next build both fail, and at runtime the expression would throw a ReferenceError while rendering the homepage.
There is a second defect hiding behind the first. The component resolves a live figure into a local stats (lines 93-116: it fetches /analytics/platform with next: { revalidate: 60 } and falls back to mockPlatformStats), and every StatCard below reads from stats. Only this one line bypasses it. So the minimal "fix the name" change — rewriting it to mockPlatformStats.activeContributors — would compile but permanently print the bundled mock contributor count in the hero while the stat grid twenty lines down prints the real one, which is the exact failure closed issue #237 was about ("HomePage's hero copy hardcodes '341 contributors' as literal text instead of referencing platformStats").
Note also that DataSourceNotice (line 189) only covers the stat grid, so a mock-sourced hero number would carry no provenance badge at all.
Why it matters
/ is the application's entry point and the highest-priority URL in the sitemap (src/lib/sitemap.ts:46 gives it priority: 1). A TS2304 here means the whole build is red, so nothing ships. If it is patched to the mock constant instead of the live one, the landing page tells every visitor a fabricated number of contributors — a trust-relevant claim on a product that moves real money — and contradicts the live "Active contributors" card rendered on the same screen.
Reproduction
npm cinpx tsc --noEmit→src/app/page.tsx(153,30): error TS2304: Cannot find name 'platformStats'.npm run buildfails with the same error. Undernpm run dev, loading/renders the Next.js error overlay instead of the homepage.
Suggested fix
Change line 153 to read from the resolved local, so the hero and the stat grid can never disagree:
{formatInteger(stats.activeContributors)} contributors
Two follow-ups worth doing in the same change:
- The live mapping at lines 106-111 assigns
activeContributors: raw.totalRepos. A repository count is not a contributor count; either the backend field name is wrong or the mapping is. Confirm against the/analytics/platformresponse before relying on this number in hero copy. - Move the
statsSource === "mock"provenance notice (line 189) above the hero's social-proof line, or add aSampleDataChipbeside it, so a fallback hero number is visibly marked as sample data.
Adding tsc --noEmit to CI would prevent an undefined identifier in a route file from reaching the default branch.
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 94
- Avg merge
- 1h 2m
- Merged PRs (30d)
- 25
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MergeFi/frontend
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug testing
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
accessibility bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MergeFi/frontend#835 · 1 comment ·
Maintainers usually reply within 1 day
All issues in MergeFi/frontend
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zapcooking/frontend#946 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
WiliamRosa/cosmos-semantic-platform#40 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
liberation-data/drivine#733 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
makecindy/cindy#10062 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day