Error: /home/user/Desktop/app/backend/views/register.pug:2:1
1| doctype html
> 2| html
-------^
3| head
4| title = title
5| body
unexpected token "indent"
at makeError (/home/user/Desktop/app/backend/node_modules/pug-error/index.js:32:13)
at Parser.error (/home/user/Desktop/app/backend/node_modules/pug-parser/index.js:53:15)
at Parser.parseExpr (/home/user/Desktop/app/backend/node_modules/pug-parser/index.js:264:14)
at Parser.parse (/home/user/Desktop/app/backend/node_modules/pug-parser/index.js:112:25)
at parse (/home/user/Desktop/app/backend/node_modules/pug-parser/index.js:12:20)
at Object.parse (/home/user/Desktop/app/backend/node_modules/pug/lib/index.js:125:22)
at Function.loadString [as string] (/home/user/Desktop/app/backend/node_modules/pug-load/index.js:45:21)
at compileBody (/home/user/Desktop/app/backend/node_modules/pug/lib/index.js:86:18)
at Object.exports.compile (/home/user/Desktop/app/backend/node_modules/pug/lib/index.js:242:16)
at handleTemplateCache (/home/user/Desktop/app/backend/node_modules/pug/lib/index.js:215:25)
at Object.exports.renderFile (/home/user/Desktop/app/backend/node_modules/pug/lib/index.js:427:10)
at Object.exports.renderFile (/home/shivtaj/Desktop/app/backend/node_modules/pug/lib/index.js:417:21)
at View.exports.__express [as engine] (/home/user/Desktop/app/backend/node_modules/pug/lib/index.js:464:11)
at View.render (/home/user/Desktop/app/backend/node_modules/express/lib/view.js:135:8)
at tryRender (/home/user/Desktop/app/backend/node_modules/express/lib/application.js:640:10)
at Function.render (/home/user/Desktop/app/backend/node_modules/express/lib/application.js:592:3)
答案 0 :(得分:0)
帕格对压痕非常敏感。上面的错误消息表明您在html
标记前面有一个空格字符,但不是这样。
将doctype html
和html
行移到最左边,因此它们前面没有空格。然后,确保其他行正确缩进(要缩进两个空格),否则您将在其余行上看到缩进错误。