Home Eco (Embedded Coffee Script) Error - Unexpected dedent
Post
Cancel

Eco (Embedded Coffee Script) Error - Unexpected dedent

Ran into this error when testing out eco (Embedded Coffee Script) templates.

Parse error on line #: unexpected dedent (in C:/project/app/assets/javascripts/backbone/templates/dartboard.jst.eco)

Broken code:

1
2
3
<% if 7 > 3 %>
  teststring
<% end %>

Fixed Code:

1
2
3
<% if 7 > 3: %>
  teststring
<% end %>

Notice the colon, this is telling coffeescript that the next line is indented. It’s document here: https://github.com/sstephenson/eco it had just slipped my mind.

This post is licensed under CC BY 4.0 by the author.