Each does not work after blaze version update

Hi

The following block does not work anymore after version update

            {{#each index in (repeat 6)}}
              <button class="btn btn-default js-change-question {{currentQuestionClass index}}" data-index="{{index}}">{{inc index}}</button>
              <i class="fa cursor-pointer js-change-question {{questionIconClass index}}" data-index="{{index}}" data-toggle="tooltip" data-placement="top" title="{{inc index}}"></i>
            {{/each}}

I have the following versions:
blaze@2.5.0
blaze-html-templates@1.2.1
blaze-tools@1.1.2

how can I fix ?

Thanks

Hi, are you sure you just updated Meteor?

What is this repeat in the first line?

What is the error that you are getting?

1 Like

Hi,

Are you sure you just updated Meteor?
Yes, I am.
$ meteor --version
Meteor 2.3.4

What is this repeat in the first line?
It is a Blaze syntax that is not supported anymore, it is supposed to be a loop from 0 to 6.

What is the error that you are getting?
The each loop is not working on the template.

I’m confused, I never used this repeat syntax (was it really a Blaze syntax?) and if you know it’s not working that is not the problem in the first place?

I assume he has (or had) a (template or global) helper repeat that no longer works, for whatever reason. The syntax is Blaze, as long as that helper exists.

1 Like

I just confirmed, as long as that helper exists, the code in question works with the latest Meteor & Blaze.

My guess is @jpfernandezl has accidentally removed the helper or just copy-pasted code but omitted the helper.

3 Likes