question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rendering <button> in each loop breaks application

See original GitHub issue

In ember 3.3.0 following template breaks application:

{{#each buttons as |button|}}
  <button>{{button}}</button>
{{/each}}

buttons is a simple array. In console I can see Uncaught Error: unreachable. This error does not happen with other tags (i.e. works fine) and does not happen on ember 3.2.2

Repository with demonstration: https://github.com/GendelfLugansk/ember-rendering-bug

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:43 (24 by maintainers)

github_iconTop GitHub Comments

11reactions
rwjbluecommented, Jul 27, 2018

Is this considered a breaking change?

Yes, it is a breaking change and we are working on the fix.

I’m also a little confused by the RFC as to whether this is allowed (and supposed to work), or allowed at build-time (but breaks at run-time).

The current behavior matches what the RFC stated (essentially that a block param named button + <button></button> in the blocks template, would assume that the block param was a yielded closure component and attempt to render it as such), but based on feedback (here and in other issues) we determined that the result is definitely something we consider a breaking change.

The current plan (after discussing with the core team on 2018-07-20) is:

  • Ensure that all block params that “shadow” normal HTML elements inside their blocks, continue to render the HTML element (and do not assume they should “invoke” a yielded component).
  • Issue a deprecation when this scenario is detected (with until: '4.0.0')
  • Ensure the linter is setup for newly generated Ember apps that will lint against using confusing block param names (where the block param could be an HTML element name, and that HTML element is invoked in the blocks template).
  • Backport these fixes to Ember 3.3
4reactions
rwjbluecommented, Jul 18, 2018

This change should not have happened during 3.3, and we will try to figure out why it did (and fix it). However, we do intend for it to land as part of 3.4 (along with support for linting in applications as a general guide).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to break out of an async for loop on button press in React
I have the following component. I want to break out of the loop when the button is clicked. How do ...
Read more >
JavaScript For Loop Click Event ← Issues & Solutions Explained
When you attach multiple click events inside a for loop in JavaScript, It always gives the last index regardless of what button is...
Read more >
How to Implement a Component Loop in React | Pluralsight
Consider a simple use case where you have to render a list of items on the DOM. 1import React from 'react'; 2import './App.css';...
Read more >
Slow rendering - Android Developers
The systrace is broken up by processes and threads. ... a user clicking a button), but remember that each allocation comes with a...
Read more >
How to solve the React useEffect Hook's infinite loop patterns
This is possible via the useEffect function; Manipulating the UI: the app should respond to a button click event (for example, opening a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found