Skip to content

🐛 [Bug]: Whack-a-Mole Game Fails to Start Due to getContext Null Error #456

@Bhavikapatel06

Description

@Bhavikapatel06

📝 Description

The Whack-a-Mole game opens successfully, but the game does not start properly after clicking the "Start Game" button.

While testing, the browser console shows the following JavaScript error:

Cannot read properties of null (reading 'getContext')

This prevents the game canvas from initializing correctly, causing the game board and interactions to fail.

🔄 Steps to Reproduce

  1. Open the Whack-a-Mole game
  2. Click on "Start Game"
  3. Observe that the game does not start
  4. Open browser DevTools Console
  5. See the getContext null error

🎯 Expected Behavior

  • The game should initialize correctly
  • Canvas/game board should render properly
  • User should be able to play the game normally

❌ Actual Behavior / Error Logs

  • Game modal opens but gameplay does not start
  • Console error appears:
    Cannot read properties of null (reading 'getContext')

💻 Environment

  • OS: Windows 11
  • Browser: Chrome / Brave
  • Issue Area: Whack-a-Mole Game

  • I am a registered GSSoC 2026 contributor.
  • I want to be assigned to fix this issue.
Image

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions