无法读取未定义的jade属性'length'到html

时间:2015-01-30 07:50:24

标签: javascript node.js pug template-engine ejs

当我将我的玉转换为html时,我在index.jade中收到此错误:

/usr/local/lib/node_modules/jade/lib/runtime.js:231
  throw err;
        ^
TypeError: index.jade:50
    48|                             i.fa.fa-plus-square
    49|                             |  Add new Question
  > 50|                     li
    51|                         a(runat='server', href='/q/about')
    52|                             i.fa.fa-question-circle
    53|                             |  About

Cannot read property 'length' of undefined
    at jade_debug.unshift.lineno (eval at <anonymous> (/usr/local/lib/node_modules/jade/lib/index.js:216:8), <anonymous>:331:31)
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/jade/lib/index.js:216:8), <anonymous>:428:4)

第50行的index.jade如下所示:

.navbar.navbar-default.navbar-fixed-top
        .container
            .navbar-header
                button.navbar-toggle(type='button', data-toggle='collapse', data-target='.navbar-collapse')
                    span.icon-bar
                    span.icon-bar
                    span.icon-bar
                a.navbar-brand(runat='server', href='/')
                    i.fa.fa-home
                    |  The Strings Project
            .navbar-collapse.collapse
                ul.nav.navbar-nav
                    li
                        a(runat='server', href='/q')
                            i.fa.fa-list-ul
                            |  Questions
                    li
                        a(runat='server', href='/q/new')
                            i.fa.fa-plus-square
                            |  Add new Question
                    li
                        a(runat='server', href='/q/about')
                            i.fa.fa-question-circle
                            |  About
                    li
                        a(runat='server', href='#')
                            i.fa.fa-phone-square
                            |  Contact

请建议我哪里出错了?我正在使用ejs作为我的模板引擎并在快速服务器上运行nodejs。

这是带有行号的图片: enter image description here

0 个答案:

没有答案