Skip to content

fix(glimmer): add assertion for invalid dynamic component argument#21405

Closed
olenderhub wants to merge 1 commit into
emberjs:mainfrom
olenderhub:fix-component-helper-invalid-argument
Closed

fix(glimmer): add assertion for invalid dynamic component argument#21405
olenderhub wants to merge 1 commit into
emberjs:mainfrom
olenderhub:fix-component-helper-invalid-argument

Conversation

@olenderhub
Copy link
Copy Markdown
Contributor

Fixes #18072

Adds a debug assertion in the dynamic component resolution opcode to throw a useful error when the {{component}} helper receives an invalid argument type, e.g. an object, instead of failing with a cryptic error.

Adds a test to verify the assertion fires with the expected message.

Tested with:

  • pnpm test:wip

@olenderhub olenderhub force-pushed the fix-component-helper-invalid-argument branch from 3def458 to c08a7c5 Compare May 17, 2026 18:52
this.render('{{component this.componentName}}', {
componentName: { name: 'not-a-component' },
});
}, /The `{{component}}` helper only accepts strings or components/);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that strings are not accepted in strict mode

@kategengler
Copy link
Copy Markdown
Member

huh, not sure what happened here .. did you rebase too far and include my commit from #main to update the version?

@olenderhub
Copy link
Copy Markdown
Contributor Author

@kategengler I am also not sure what happened there - I wanted to push changes by force. I created another one PR with including @NullVoxPopuli suggestion

#21406

@olenderhub olenderhub closed this May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unreachable code "reached" when trying to render a non-string with the component helper

3 participants