Conversation
…l open Add debounce=50 and minWidth:1 to ResponsiveContainer in FeedbackChart. Recharts fires its first resize measurement before the admin panel layout settles, getting width=0, which causes createPattern to throw on a 0-dim canvas. debounce defers the first render tick; minWidth prevents a 0 from ever being reported.
fix(results-panel): guard Recharts 0-width canvas crash on admin panel open
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jun 25, 2026
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.
Summary
debounce={50}andstyle={{ minWidth: 1 }}toResponsiveContainerinFeedbackChartinsideProgramResultsSummarySectionRoot cause
When the admin wallet unlocks and the completed-program results panel expands, the CSS layout transition means
ResponsiveContainerfires its firstResizeObservertick withwidth=0. Recharts then attempts to create a Canvas gradient pattern on a 0×0 canvas:debounce={50}defers the first measurement by 50ms so the layout settles first.minWidth: 1is a belt-and-suspenders guard.Why it didn't catch in testing
stadium-testerruns in mock mode — admin panel is already visible before data loads, no layout transition, chart always gets non-zero width on first renderexpect()assertion fails; this error fires during mount, not tied to any UI state assertionCompanion CORS error (no code change needed)
The console also showed
No 'Access-Control-Allow-Origin' headeronGET /api/programs/bitrefill-2026. That was a transient Railway container-swap gap during deploy — old container down before new one was serving. Server is healthy;stadium.joinwebzero.comis in the explicit CORS allowlist.Test plan
cd client && npm run buildpasses ✓ (verified pre-PR)Fixes prod regression introduced by #195.