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

Luke Sims
Luke Sims
5,767 Points

For anyone getting a 'getting RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: undefined in express app'

The problem is to do with your pug file indentation, and with the fact that some error codes have not been accounted for. The following stack overflow explains this better, but when I accounted for the status 500 error code, I was able to see that my indentation in my pug file was using spaces and tabs, which vs code sometimes automatically switches between... (how annoying!). You can only use one or the other, and you can see this by highlighting the part of the file you are unsure of.

https://stackoverflow.com/questions/49210127/getting-rangeerror-err-http-invalid-status-code-invalid-status-code-undefine