I'm running Jade as a templating engine with Express/node.js, and whenever I get a syntax error in my .jade file, i get a report like this:
at new JS_Parse_Error (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:196:18)
at js_error (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:204:11)
at croak (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:636:9)
at token_error (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:644:9)
at expect_token (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:657:9)
at expect (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:660:36)
at expr_atom (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:1112:17)
at maybe_unary (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:1287:19)
at expr_ops (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:1322:24)
at maybe_conditional (/home/hoylemd/code/Javascript/nodejs/simplewebsite/node_modules/jade/node_modules/with/node_modules/uglify-js/lib/parse.js:1327:20)
This doesn't tell me anything about what went wrong. I've heard nothing bug good things about Jade, but a templating engine that doesn't tell me anything about a syntax error is little better than useless. Can anyone shed some light on what's going on?
I can suggest you to use Grunt for your workflow. The output from Grunt JADE is something like this:
Running "jade:compile" (jade) task
TypeError: src/jade/index.jade:20
18| div.page-header
19|
> 20| h3(.text-muted Header Here
21|
22| div.row
23| div.col-xs-12
To use Grunt, you can check: www.gruntjs.org
And to use Jade with Grunt, check: https://npmjs.org/package/grunt-contrib-jade
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With