kyr
kyr

Reputation: 39

Jade compiling: 'Unexpected Token "dot"'

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

Answers (1)

Dan Uznanski
Dan Uznanski

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

Related Questions