I'm trying to compile a very simple Jade template:
p hi
Here's the corresponding Javascript (JQuery is loaded in):
var jade = require('jade');
$('#container').html(jade.compile('../jade/gen.jade'));
It throws the Error Error: unexpected token "dot" on execution. Why is this?
jade.compile takes a source string, not a filename. try jade.compile('p hi') or jade.compileFile('../jade/gen.jade') instead.