I got node.js express
app using jade
. And I use jade mixins
. I edited jade file, after that got error on 44 line
:
unexpected token "indent"
42| -i++
43|
> 44| include select
45|
46| mixin mainInputs()
select
is jade
file in the same directory with target mixin
.
On picture you can see that there is no extra spacing (dot signs in sublime) on line 44
I already run command Indentation: Convert to Spaces
in sublime text 3
but got the same error.
I tried to rename file select.jade
to selectFile.jade
to exclude confusion with select
html tag, but still got the same error.
Update:
I tested select.jade
independently:
select.jade:3
1| include labelFor
2| mixin select(id, text, placeholder)
> 3| mixin labelFor(id, text)
4| select(id="#{id}", name="#{text}", data-placeholder="#{placeholder}")
5| option
6|
unexpected token "indent"
Then I tested labelFor.jade
:
mixin labelFor(id, text)
div
div.label
label(for="#{id}")= text
br
labelFor.jade
executed without errors.
I searched tabs \t
in file select.jade
. But it contains only spaces, no tabs.
The problem was in extra spaces after line
mixin select(id, text, placeholder)
in file select.jade
.
It was:
'include labelFor\nmixin select(id, text, placeholder) \n mixin labelFor(id, text)\n select(id="#{id}", name="#{text}", data-placeholder="#{placeholder}")\n option\n\n'
After I change it to ...
'include labelFor\nmixin select(id, text, placeholder)\n mixin labelFor(id, text)\n select(id="#{id}", name="#{text}", data-placeholder="#{placeholder}")\n option\n\n'
... error fly away.