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
Christopher Stuart
Full Stack JavaScript Techdegree Graduate 27,771 PointsPug Issue
I'm having a problem on error template in this video
extends layout
block content
h1 = error.message
h2 = error.status
h3 = error.stack
When i try this i get stack undefined, so when i try to remove the stack line, the error prints out but the two errors actually show the equals sign. Anyone know where I'm going wrong here?
1 Answer
Jimmy Crandall
23,120 PointsTry removing the whitespace between the element tag and the equal sign.
extends layout
block content
h1= error.message
h2= error.status
pre= error.stack
As seen in your example that worked, when using interpolation you don't follow the syntax of
<element>= <variable>
extends layout
block content
h1 #{error.message}
h2 #{error.status}
pre #{error.stack}
Christopher Stuart
Full Stack JavaScript Techdegree Graduate 27,771 PointsChristopher Stuart
Full Stack JavaScript Techdegree Graduate 27,771 PointsI'm not sure why---but this worked--for anyone else having this issue