Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Object-Oriented JavaScript: Challenge Rendering the Game startGame() Method Solution

James Fleming
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
James Fleming
Full Stack JavaScript Techdegree Graduate 15,848 Points

Receiving an error that I can't seem to solve. Board.js:35 Uncaught TypeError: space.drawSVGSpace is not a function.

I am getting the start button to show up but when I click it, nothing happens and I get errors in the console.

I can't figure out why I'm receiving this error. The complete error is as follows:

Board.js:35 Uncaught TypeError: space.drawSVGSpace is not a function at Board.drawHTMLBoard (Board.js:35) at Game.startGame (Game.js:24) at HTMLButtonElement.<anonymous> (app.js:8) drawHTMLBoard @ Board.js:35 startGame @ Game.js:24 (anonymous) @ app.js:8

My repository can be found here: https://github.com/Bigjames728/4-in-a-Row.git

If there is another way I should show my code please let me know. Since I don't know exactly where the error is I didn't know which part I should copy paste. It does say line 35 of my Board.js file but I can't find anything there. Thanks so much for any help provided!!

1 Answer

Cameron Childres
Cameron Childres
11,820 Points

Hi James,

Board.js line 35 is written as "drawSVGSpace()" but Space.js line 27 names the function as "drawSVGSpaces()".

Once that's fixed you'll hit another error on Game.js line 25 since there isn't yet a getter for activePlayer. Either comment out that line for now or add in the getter and you'll be able to see the board drawn.