Uexpected token 'tag' jade node.js

Problem

I get:

    Unexpected token 'tag' expected 'text', 'code', ':', 'newline' or 'eos'

because of this code:

        label(for="polaziste")Polaziste

in

#main
    form(action="/raspored" method=post)
        label(for="polaziste")Polaziste
        input(type="list" id="polaziste")
        datalist#polaziste
            for pol,i in popis
                option(value = pol)

Why? :)

Problem courtesy of: ditoslav

Solution

Try this:

label(for="polaziste") Polaziste

Notice space before Polaziste.

Solution courtesy of: vmx

Discussion

For others visiting, this error also (expectedly) appears when using the jade API incorrectly.

per the docs

var fn = jade.compile('string of jade', options);

however, if you accidentally interpret this as

var fn = jade.compile('/path/to/file.jade', options);

you will have issue. :)

Discussion courtesy of: cdaringe

This recipe can be found in it's original form on Stack Over Flow.