Skip to content

fix(script.js): resolve buildProjectCard crash#827

Open
nancysangani wants to merge 1 commit into
komalharshita:mainfrom
nancysangani:fix/build-project-card-crashes
Open

fix(script.js): resolve buildProjectCard crash#827
nancysangani wants to merge 1 commit into
komalharshita:mainfrom
nancysangani:fix/build-project-card-crashes

Conversation

@nancysangani

Copy link
Copy Markdown

Fixes #745buildProjectCard crashes at runtime, recommendation results never render.

Root causes

The issue report identified three bugs. The actual root in the code is a single bad merge that caused them all:

  1. createTag was missing its closing } — this made renderResults, buildProjectCard, and all code between them nested inside createTag's function body, so they were effectively unreachable/mis-scoped at call time.
  2. A duplicate renderResults with a stray main token was nested inside the unclosed createTag — a merge conflict artifact that was never resolved.
  3. A second duplicate renderResults and a misplaced renderSavedProjects() call appeared below buildProjectCard — also from the same bad merge.

Fix

  • Added the missing } to close createTag.
  • Removed the two duplicate renderResults definitions and the stray renderSavedProjects() call.

The canonical renderResults at its original location (with resultsGrid.innerHTML clear, null-guard on emptyMessageEl, and correct grid/empty-state toggle) is fully preserved. truncate and createTag remain as module-level helpers. buildProjectCard now executes correctly and returns the card element.

Testing

  • node --check static/script.js → no syntax errors
  • Manually: python app.py → enter Python / Beginner / Data / Low → Generate My Projects → 3 cards render, no console errors

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

@nancysangani is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

@nancysangani

Copy link
Copy Markdown
Author

Hi @komalharshita, please review the PR when you get a chance. Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: buildProjectCard in static/script.js crashes — recommendation results never render

1 participant