Reputation: 39
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?
Upvotes: 0
Views: 1503
Reputation: 126
jade.compile takes a source string, not a filename. try jade.compile('p hi') or jade.compileFile('../jade/gen.jade') instead.
Upvotes: 1