输入是自我关闭的,不应该有内容

Cal*_*der 10 node.js express pug

当我加载我的Express网页时,我收到以下错误:

Express 500错误:/app/views/index.jade:114 112 | td 2 113 | td 4年> 114 | 输入是自我关闭的,不应该有内容.

112| td 2
113| td 4 years
> 114|
input is self closing and should not have content.
at Object.Compiler.visitTag (/app/node_modules/jade/lib/compiler.js:434:15)
at Object.Compiler.visitNode (/app/node_modules/jade/lib/compiler.js:210:37)
at Object.Compiler.visit (/app/node_modules/jade/lib/compiler.js:197:10)
at Object.Compiler.visitBlock (/app/node_modules/jade/lib/compiler.js:278:12)
at Object.Compiler.visitNode (/app/node_modules/jade/lib/compiler.js:210:37)
at Object.Compiler.visit (/app/node_modules/jade/lib/compiler.js:197:10)
at Object.Compiler.visitTag (/app/node_modules/jade/lib/compiler.js:443:12)
at Object.Compiler.visitNode (/app/node_modules/jade/lib/compiler.js:210:37)
at Object.Compiler.visit (/app/node_modules/jade/lib/compiler.js:197:10)
at Object.Compiler.visitBlock (/app/node_modules/jade/lib/compiler.js:278:12)
Run Code Online (Sandbox Code Playgroud)

当使用foreman start在本地运行时,这不显示,只有当它在服务器上时才会出现.

Jep*_*ron 16

看起来你的输入标签里面有内容.在HTML中,输入标签不能包含内容,
因此您应该删除jade文件中输入标签后面的任何空格或字符.
例如:
input(type="text",name="whatever") something
应该是
input(type="text",name="whatever",value="something")