Skip to content

"Sequence contains no elements" error for empty block helpers #224

Closed

Description

@drewbj21

Hi,

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!

Activity

  1. mikeprince3 commented on Sep 25, 2017

    @mikeprince3
    Contributor
  2. drewbj21 commented on Oct 4, 2017

    @drewbj21
    Author

    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?

  3. rexm commented on Oct 4, 2017

    @rexm
    Member

    Yes, it is a bug

  4. slahn commented on May 4, 2018

    @slahn

    I can't reproduce this with the newest version (1.9.3)

  5. rexm commented on May 26, 2018

    @rexm
    Member

    This is now fixed as of v1.9.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions