emberjs / emberjs/ember.js

[Bug] Cryptic error when using a local template variable with the same name as an HTML element

Open
#20,058 3 comments 1 reaction 0 assignees View on GitHub
Error Handling
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

### 🐞 Describe the Bug

If you have the following template:

```hbs

{{#each (array "a" "b" "c") as |option|}}
hello
{{/each}}

```

We get the following error:

```
Uncaught Error: Expected a component definition, but received a. You may have accidentally done <(result of a `unknown` helper)>, where "(result of a `unknown` helper)" was a string instead of a curried component definition. You must either use the component definition directly, or use the {{component}} helper to create a curried component definition when invoking dynamically.
```

I had to read it a couple times to understand what it's telling me 😅

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.