You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Sequence contains no elements" error for empty block helpers #224
I'm trying to do the following and get "Sequence contains no elements" error.
{{#if true}}{{else}}
It doesn't work!
{{/if}}
But it works fine when I do this:
{{#if true}}
{{else}}
It's not true.
{{/if}}
I'd prefer to not have to put an empty line in and it seems like it should still work that way. I've had this issue come up with other built-in helpers too. Has anyone else encountered this issue? Thanks in advance for the help!
Yes, that is definitely a better way to achieve the same thing but the problem is that some of our customers don't understand that...
I guess I'm wondering if the spacing issue I described above is something that needs to fixed. The spacing doesn't matter for similar logic in a language like C# so would this be a bug in handlebars?
Activity
mikeprince3 commentedon Sep 25, 2017
The #unless helper might be what you are looking for.
http://handlebarsjs.com/builtin_helpers.html
drewbj21 commentedon Oct 4, 2017
Yes, that is definitely a better way to achieve the same thing but the problem is that some of our customers don't understand that...
I guess I'm wondering if the spacing issue I described above is something that needs to fixed. The spacing doesn't matter for similar logic in a language like C# so would this be a bug in handlebars?
rexm commentedon Oct 4, 2017
Yes, it is a bug
slahn commentedon May 4, 2018
I can't reproduce this with the newest version (1.9.3)
rexm commentedon May 26, 2018
This is now fixed as of v1.9.3.