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 trialRohit Thorat
12,191 Pointsindentation problem
extends layout.pug
block content
section#content
h2 Welcome,#{name}!
what is wrong in the code? my /hello route is working fine but when i am giving the name as input my home route is showing error..
1 Answer
Zack Lee
Courses Plus Student 17,662 Pointspug is extremely sensitive with tabs and spaces. you must be consistent across the file when using tabs or spaces. This is annoying cause its hard to tell where tabs vs spaces are used, especially when copy/pasting some template into your file. I would go through and just make sure if you use tabs or spaces that its consistent across the file.
Neil McPartlin
14,662 PointsRohit, Zack has called it. If you remove that single space before the word 'block', your snippet will work.
Nick Burton
7,387 PointsIn addition to what Zack said, most modern editors allow your tab key to actually insert spaces instead of tabs, you can usually set the number of spaces as well. This is useful for all around consistence and especially useful while using Pug.
Albert Boehm
5,878 PointsAlbert Boehm
5,878 PointsCould you post the related app.js code snippet? It is hard to judge what might've gone wrong from this alone.