So, for my Express site, I use jade. So I decided to try changing the layout file so that I could start developing my site. I changed the layout source code (which worked), but I started getting indentation errors in any file that extends the layout as follows:
500 Error: /home/kevin/Blue/views/layout.jade:6 4| p Hello World Invalid indentation, you can use tabs or spaces but not both 4| p Hello World Invalid indentation, you can use tabs or spaces but not both at Object.Lexer.indent (/home/kevin/Blue/node_modules/jade/lib/lexer.js:679:15) at Object.Lexer.next (/home/kevin/Blue/node_modules/jade/lib/lexer.js:777:15) at Object.Lexer.lookahead (/home/kevin/Blue/node_modules/jade/lib/lexer.js:107:46) at Object.Parser.lookahead (/home/kevin/Blue/node_modules/jade/lib/parser.js:115:23) at Object.Parser.peek (/home/kevin/Blue/node_modules/jade/lib/parser.js:92:17) at Object.Parser.tag (/home/kevin/Blue/node_modules/jade/lib/parser.js:640:22) at Object.Parser.parseTag (/home/kevin/Blue/node_modules/jade/lib/parser.js:624:17) at Object.Parser.parseExpr (/home/kevin/Blue/node_modules/jade/lib/parser.js:198:21) at Object.Parser.block (/home/kevin/Blue/node_modules/jade/lib/parser.js:592:25) at Object.Parser.tag (/home/kevin/Blue/node_modules/jade/lib/parser.js:721:26)
So I have the code:
index.jade
extends layout block content p Hello World
and
doctype 5 html head title= title link(rel='stylesheet', href='/stylesheets/style.css') body div
Keep in mind that I didnโt do anything wrong, and I know how to properly link files using the extends option. In fact, the code worked fine until I started messing with the layout file. All of this is basically a problem. I tried to find out if this is a text editor causing this problem, and I could not figure out if this is because I cannot get the code to work again.
I am using the sublime text 2 editor to write this jade code. If the text editor is not backing down correctly, can someone help me find out how to fix it?
javascript indentation sublimetext2 pug express
Kivo360
source share