fix: resolve project content unavailable error and dashboard stats Typeerror - #1696
Conversation
|
@nishtha-agarwal-211 is attempting to deploy a commit to the Anuj's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
🎉 Thank you for your contribution! Your Pull Request has been merged successfully. |
|
Hey @steam-bell-92 — following up here since this PR Checked the actual merge commit (c028845) directly: 86 opening braces vs. 85 closing ones — the function never got its closing Happy to open a follow-up PR with the actual fix if that's useful — should |
Fixes #1504
📝 Description & Root Cause
Eager Evaluation Crash in
projects.jsgetProjectHTML(spanning lines 4–42) contained a static mapping object that eagerly executed all project-render functions (e.g.getRockPaperScissorHTML(),getResumeAnalyzerHTML(), etc.) during script initialization.resume-analyzerproject and its dependencies were completely removed in a previous commit, callinggetResumeAnalyzerHTML()threw an uncaughtReferenceError: getResumeAnalyzerHTML is not defined. This crash halted script execution, preventing subsequent functions (includinginitializeProjectand the active dynamicgetProjectHTMLfunction) from attaching to the globalwindowobject. This fallback led to the "Project content unavailable" error.Dashboard Statistics TypeErrors in
index.html#statsFavorites,#statsTotal, etc. had been previously removed fromindex.html.TypeError: Cannot set properties of null (setting 'textContent')on load.🚀 Proposed Changes
Clean up
web-app/js/projects.jsgetProjectHTML()function definition (the one eagerly executing all project HTML calls).getProjectHTMLandinitializeProjectfunctions dynamically.Fix Page Errors & Animate Hero Stats in
web-app/index.htmlanimateCounterand statistics updates (e.g.,#statsFavorites) to prevent null-reference runtime exceptions when elements do not exist.heroProjectCount,heroGameCount,heroMathCount,heroUtilityCount,heroFavoriteCount,heroViewedCount) to provide a dynamic and animated entry on the landing page.