unexpected token "indent"

水深无声 2022-04-23 03:10 350阅读 0赞

1、错误描述

  1. F:\dojo\abcd\abcc\views\login\login.pug:3:1 1| doctype html 2| > 3| h1= title -------^ 4| p Welcome to #{title} 5| div(class='div_style') unexpected token "indent"
  2. Error: F:\dojo\abcd\abcc\views\login\login.pug:3:1
  3. 1| doctype html
  4. 2|
  5. > 3| h1= title
  6. -------^
  7. 4| p Welcome to #{title}
  8. 5| div(class='div_style')
  9. unexpected token "indent"
  10. at makeError (F:\dojo\abcd\abcc\node_modules\pug-error\index.js:32:13)
  11. at Parser.error (F:\dojo\abcd\abcc\node_modules\pug-parser\index.js:53:15)
  12. at Parser.parseExpr (F:\dojo\abcd\abcc\node_modules\pug-parser\index.js:257:14)
  13. at Parser.parse (F:\dojo\abcd\abcc\node_modules\pug-parser\index.js:112:25)
  14. at parse (F:\dojo\abcd\abcc\node_modules\pug-parser\index.js:12:20)
  15. at Object.parse (F:\dojo\abcd\abcc\node_modules\pug\lib\index.js:126:22)
  16. at Function.loadString [as string] (F:\dojo\abcd\abcc\node_modules\pug-load\index.js:45:21)
  17. at compileBody (F:\dojo\abcd\abcc\node_modules\pug\lib\index.js:86:18)
  18. at Object.exports.compile (F:\dojo\abcd\abcc\node_modules\pug\lib\index.js:243:16)
  19. at handleTemplateCache (F:\dojo\abcd\abcc\node_modules\pug\lib\index.js:216:25)

2、错误原因

  1. 在主体内容前,需要添加block content,用作标识开始
  2. doctype html
  3. h1= title
  4. p Welcome to #{title}
  5. div(class='div_style')

3、解决办法

  1. doctype html
  2. block content
  3. h1= title
  4. p Welcome to #{title}
  5. div(class='div_style')

发表评论

表情:
评论列表 (有 0 条评论,350人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Unexpected token <

    html页面出现这种情况 问题原因主要是由于js/css文件没有正常加载 报错302可以在浏览器控制台查看文件加载的返回码 1.文件没有正常加载可能由于在html中引入的