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 Build a Simple Dynamic Site with Node.js HTTP Methods and Headers Perfection Suggestions

Duarte Monteiro
Duarte Monteiro
22,300 Points

Node.js writing undefined on the console

Hi, I have complete the app and it runs fine but I'm just wondering why it fires a series of undefined on the console every time I make a new search,

treehouse:~/workspace$ node app                                                                   
Server running at port 3000                                                                       
undefined                                                                                         
undefined                                                                                         
undefined                                                                                         
undefined                                                                                         
undefined                                                                                         
undefined 

I have attached a screenshot of my workspace https://w.trhou.se/6avoi1674t

1 Answer

Just in case anyone is getting this error, too: the reason you're getting a bunch of "undefined"s is that in your renderer.js file, in your view function, you have a console.dir statement.

So every time the renderer is trying to use the view function, it calls console.dir(), which is undefined. If you delete that one line of code from your renderer.js file, you will stop seeing it.