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

v1.13.0-beta.2 - Uncaught Error: Assertion Failed: Expected component:chosen-select to resolve to an Ember.Component but instead it was (subclass of Ember.Select). #11324

Closed
ChrisHonniball opened this issue Jun 2, 2015 · 6 comments

Comments

@ChrisHonniball
Copy link

I'm getting:

Uncaught Error: Assertion Failed: Expected component:chosen-select to resolve to an Ember.Component but instead it was (subclass of Ember.Select).

I had the same error when extending the default Ember.View which was not a big deal because I just made it a Ember.Component and updated a few lines of code but what about if I want to extend Ember.Select or other built in components (i.e., Ember.TextArea). What is the right technique after 1.13.0? Thanks for the help!

@rwjblue
Copy link
Member

rwjblue commented Jun 2, 2015

This assertion has been changed to a deprecation, and will be updated in 1.13.0-beta.3 soonish.

You can use the latest from the beta channel for now.

@ChrisHonniball
Copy link
Author

Since it's a deprecation is there a new method for extending existing components?

@rwjblue
Copy link
Member

rwjblue commented Jun 2, 2015

Extending from something that is an Ember.Component is totally fine, and doesn't have an issue. If you are extending from Ember.Select though, it is an Ember.View (not a component at all) which is what triggers the deprecation.

@ChrisHonniball
Copy link
Author

I see.

If I wanted to extend these controls am I still able to? I could just wrap them inside a component and do my necessary work on the wrapped elements if this isn't going to be something I have access to.

@rwjblue
Copy link
Member

rwjblue commented Jun 2, 2015

The change was made in #11261 and tweaked in #11300. All you should need to do is:

var CustomSelect = Ember.Select.extend();

CustomSelect.reopenClass({
  isComponentFactory: true
});

export default CustomSelect;

To get rid of the deprecation.

@ChrisHonniball
Copy link
Author

Good to go! As always, I seriously appreciate it! 🍻

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

No branches or pull requests

2 participants