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

Multiple user request in course 'Build a Simple Dynamic Site with Node.js'

The course is 'Build a Simple Dynamic Site with Node.js' by Andrew Chalkers, the lesson "reading Files".

Just load and finish the code created by Andrew (remember to replace HTTP with HTTPS as a result of recent changes in Treehouse) in Profile.js and then run the app on localhost with Chrome. Keep switching between real user (chalkers) and fake user (chalkers123) back and forth. Ultimately the app will crash. I tracked down the error and what's happening is that when I put a real user (chalkers) after putting a fake user (chalker123) the browser is issuing two requests at the same time for chalkers, with the second while the first is still running. As a result the second request overlaps with the first and it crashes with message "write after end". Andrew in his testing runs each case just once. I wish he tried to run them back and forth several times. Anybody run into this problem? Should I try to fix it, or just ignore it and proceed with the course?

Thanks, Cezar