Skip to content

fix: resolve project content unavailable error and dashboard stats Typeerror - #1696

Merged
steam-bell-92 merged 2 commits into
steam-bell-92:mainfrom
nishtha-agarwal-211:fix/project-content-unavailable
Jul 16, 2026
Merged

fix: resolve project content unavailable error and dashboard stats Typeerror#1696
steam-bell-92 merged 2 commits into
steam-bell-92:mainfrom
nishtha-agarwal-211:fix/project-content-unavailable

Conversation

@nishtha-agarwal-211

Copy link
Copy Markdown
Contributor

Fixes #1504

📝 Description & Root Cause

  1. Eager Evaluation Crash in projects.js

    • Root Cause: The duplicate/unused declaration of getProjectHTML (spanning lines 4–42) contained a static mapping object that eagerly executed all project-render functions (e.g. getRockPaperScissorHTML(), getResumeAnalyzerHTML(), etc.) during script initialization.
    • The Bug: Since the resume-analyzer project and its dependencies were completely removed in a previous commit, calling getResumeAnalyzerHTML() threw an uncaught ReferenceError: getResumeAnalyzerHTML is not defined. This crash halted script execution, preventing subsequent functions (including initializeProject and the active dynamic getProjectHTML function) from attaching to the global window object. This fallback led to the "Project content unavailable" error.
  2. Dashboard Statistics TypeErrors in index.html

    • Root Cause: The statistics dashboard section containing elements like #statsFavorites, #statsTotal, etc. had been previously removed from index.html.
    • The Bug: The initialization script still attempted to set properties on these non-existent elements, throwing TypeError: Cannot set properties of null (setting 'textContent') on load.

🚀 Proposed Changes

  1. Clean up web-app/js/projects.js

    • Deleted the obsolete duplicate getProjectHTML() function definition (the one eagerly executing all project HTML calls).
    • The script now successfully evaluates, registering the correct getProjectHTML and initializeProject functions dynamically.
  2. Fix Page Errors & Animate Hero Stats in web-app/index.html

    • Added robust defensive checks to animateCounter and statistics updates (e.g., #statsFavorites) to prevent null-reference runtime exceptions when elements do not exist.
    • Retargeted the statistics counter animation directly onto the active hero statistic counters (heroProjectCount, heroGameCount, heroMathCount, heroUtilityCount, heroFavoriteCount, heroViewedCount) to provide a dynamic and animated entry on the landing page.

Copilot AI review requested due to automatic review settings July 15, 2026 17:12
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

@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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@steam-bell-92 steam-bell-92 added type:bug Something isn't working level:beginner gssoc:approved GSSoC 2026 approving tag labels Jul 16, 2026
@steam-bell-92
steam-bell-92 merged commit c028845 into steam-bell-92:main Jul 16, 2026
3 of 4 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Thank you for your contribution!

Your Pull Request has been merged successfully.
Thanks again for your support! 🙌

@nishtha-agarwal-211
nishtha-agarwal-211 deleted the fix/project-content-unavailable branch July 20, 2026 07:00
@ruhelamahi7-code

Copy link
Copy Markdown
Contributor

Hey @steam-bell-92 — following up here since this PR
claims to fix #1504, but the bug is still present on both main and the live
site as of now.

Checked the actual merge commit (c028845) directly: web-app/js/projects.js
still has the duplicate/unclosed getProjectHTML() function this PR was
meant to remove. Running it through Node confirms a real syntax error:

node --check web-app/js/projects.js
→ SyntaxError: Unexpected end of input

86 opening braces vs. 85 closing ones — the function never got its closing
} or a return statement removed/fixed. As a result the entire file fails
to parse, so every project card still shows "Project content unavailable"
on both localhost and https://python-mini-project-lovat.vercel.app/ right now.

Happy to open a follow-up PR with the actual fix if that's useful — should
just be deleting the leftover duplicate block (lines ~4–42) properly this time.

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

Labels

gssoc:approved GSSoC 2026 approving tag level:beginner type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: "Surprise Me" Button and Project Modals Showing "Project content unavailable"

4 participants