Skip to content

resolve syntax errors in script.js breaking project recommendations#697

Open
Kazuma-Codes wants to merge 1 commit into
komalharshita:mainfrom
Kazuma-Codes:fix/frontend-bug
Open

resolve syntax errors in script.js breaking project recommendations#697
Kazuma-Codes wants to merge 1 commit into
komalharshita:mainfrom
Kazuma-Codes:fix/frontend-bug

Conversation

@Kazuma-Codes
Copy link
Copy Markdown

@Kazuma-Codes Kazuma-Codes commented May 29, 2026

Summary

Fixed critical JavaScript syntax errors in static/script.js that completely broke the project recommendation feature. The fetch API's .catch() error handler contained a duplicated payload variable block instead of proper error handling logic, and was missing closing brackets. Additionally, the renderResults function had a duplicated and incorrectly nested if (!projects || projects.length === 0) conditional block. These two issues caused a SyntaxError: Unexpected end of input at line 933, preventing the browser from executing any client-side JavaScript — making the entire "Find Projects" form non-functional.

Related Issue

Closes #672

Type of Change

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed

File Change made
static/script.js Fixed broken .catch() block — replaced duplicated payload code with proper error handling and restored missing closing brackets
static/script.js Fixed renderResults() — removed duplicated nested empty-check conditional and consolidated into a single block

How to Test This PR

  1. Clone this branch: frontend-bug
  2. Install dependencies: pip install -r requirements.txt
  3. Verify the JavaScript has no syntax errors: node -c static/script.js (should produce no output)
  4. Run the app: python app.py
  5. Open http://127.0.0.1:5000/
  6. Enter a skill, select Experience Level, Area of Interest , Time Availability
  7. Click the submit button — project recommendation cards should now appear

Expected test output:

27 passed, 0 failed out of 27 tests

Test Results

40 passed, 0 failed out of 40 tests

Self-Review Checklist

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

The root cause was static/script.js as duplicated code blocks broke the .catch() handler and renderResults()

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

@github-actions github-actions Bot added gssoc-2026 type:bug Something isn't working type:accessibility ui and removed type:bug Something isn't working gssoc-2026 labels May 29, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Thank you for submitting your first pull request to DevPath.

Before review:

  • Complete the PR template fully
  • Ensure all tests pass
  • Link your PR to an issue
  • Keep changes scoped to the issue

A maintainer will review your contribution soon.

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]: Frontend form completely broken due to syntax errors in script.js

1 participant