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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Shandelle Brown](https://uploads.teamtreehouse.com/production/profile-photos/4591422/micro_14705678_10208652986975267_7263884329671808753_n.jpg)
Shandelle Brown
18,902 PointsSyntaxError when no code exists on that line.
I'm getting an error when I try to run node app.js in the browser.
"SyntaxError: Unexpected token }"
It points to line 19 of app.js, but the code doesn't even reach to line 18 of my file. My Code:
var router = require("./router.js"); //Problem: We need a simple way to look at a user's badge count and JavaScript points from a web browser //Solution: Use Node.js to perform the profile lookups and serve our templates via HTTP
//Create a web server var http = require('http'); http.createServer(function (request, response) { router.home(request, response); router.user(request, response); }, 1000); //response.end('Hello World\n'); }).listen(3000); console.log('Server running at http://<workspace-url>/');
//Function that handles the reading of files and merge in values //read from file and get a string // merge values in to string
1 Answer
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsWithout code formatting, it's hard to tell what's code and what's comment, but assuming this is one of the code lines:
}).listen(3000);
That close brace (and the close parenthesis too) have no corresponding opens to balance them.
![Neil McPartlin](https://secure.gravatar.com/avatar/28c97e648f2f03d369da419a0365bdcb?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Neil McPartlin
14,662 PointsYep. Steven is correct. I have just been doing this video and you have accidentally left in a remnant from the setInterval test Andrew did earlier. If you delete...
}, 1000);
...that should help.
Steven Parker
230,688 PointsSteven Parker
230,688 PointsTo display code property (including lines and spacing), use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area.
Or watch this video on code formatting.