Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug using hash and array helpers together #18693

Closed
mansona opened this issue Jan 23, 2020 · 6 comments · Fixed by #18743
Closed

Bug using hash and array helpers together #18693

mansona opened this issue Jan 23, 2020 · 6 comments · Fixed by #18743
Assignees

Comments

@mansona
Copy link
Member

mansona commented Jan 23, 2020

There seems to be a bug that was introduced in [email protected] 🤔but interestingly it doesn't seem to have been happening on ember-canary before the beta was released

Essentially it looks like using the {{array}} and {{hash}} helpers together doesn't work with the error:

TypeError: Cannot convert object to primitive value

I have produced a replication and run tests with ember try here: mansona/bug-hash-array-reproduction#1 and the build is here https://travis-ci.com/mansona/bug-hash-array-reproduction/builds/145761580

You will see that it fails on ember-beta and ember-canary.

Here is the example of the template that fails:

<table>
  <tbody>
    {{#each
      (array
        (hash value='' name='all')
        (hash value='x' name="horizontal")
        (hash value='y' name="vertical")
        (hash value='t' name="top")
        (hash value='r' name="right")
        (hash value='b' name="bottom")
        (hash value='l' name="left")
      ) as |item|
    }}

      <tr>
        <td>{{item.value}}</td>
        <td>{{item.name}}</td>
      </tr>
    {{/each}}
  </tbody>
</table>

The table is not required, I just put it in there to make it clear what an example app might be 👍

@rwjblue
Copy link
Member

rwjblue commented Jan 23, 2020

Hmm, thank you for reporting! Definitely seems like a regression to me.

@mansona
Copy link
Member Author

mansona commented Feb 4, 2020

Has there been any update on this? I see that we've cut a new beta but it doesn't seem to have changed anything 🤔

@pzuraq
Copy link
Contributor

pzuraq commented Feb 5, 2020

Tracked down the root cause and have opened up a PR to fix upstream in the VM: glimmerjs/glimmer-vm#1022

@mansona
Copy link
Member Author

mansona commented Feb 7, 2020

thanks a million for fixing this @pzuraq 🎉 I'm assuming this will be backported into the 3.17 release branch then once it's fixed so that beta will start working again?

@mansona
Copy link
Member Author

mansona commented Feb 18, 2020

It looks like this has started working now 🎉 I'm assuming the fix was included in v3.17.0-beta.5 then?

Thanks everyone for working on this

@mansona mansona closed this as completed Feb 18, 2020
@chancancode
Copy link
Member

@mansona I don't think so, the only change in beta 5 is docs

@chancancode chancancode reopened this Feb 20, 2020
GCheung55 added a commit to GCheung55/ember.js that referenced this issue Feb 21, 2020
GCheung55 added a commit to GCheung55/ember.js that referenced this issue Feb 21, 2020
GCheung55 added a commit to GCheung55/ember.js that referenced this issue Feb 21, 2020
GCheung55 added a commit to GCheung55/ember.js that referenced this issue Feb 21, 2020
rwjblue pushed a commit to GCheung55/ember.js that referenced this issue Feb 21, 2020
rwjblue pushed a commit to GCheung55/ember.js that referenced this issue Feb 21, 2020
rwjblue added a commit that referenced this issue Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants