Search code examples
javascriptember.jsember-cli

Uncaught Error: Assertion Failed: Attempted to register a view with an id already in use: name


I randomly started getting this error Uncaught Error: Assertion Failed: Attempted to register a view with an id already in use: name on my app using ember-cli. I have only two routes

Router.map(function() {
  this.route('buy');
  this.route('rent');
});

no controllers, my index route redirects me to buy

redirect: function() {
  this.transitionTo('buy');
}

and my rent route also renders the buy template

renderTemplate: function() {
  this.render('buy');
}

I don't have a rent or index template. I have no idea where this error is coming from.


Solution

  • I figured out why, turns out I had two inputs with the same id on my template, {{ input name="name" id="name" placeholder="Full Name" class="full-width" }} twice in different places. It would be useful if the error message could be more informative and give you a line on your actual code instead of showing just the line throw new EmberError("Assertion Failed: " + desc); on you vendor.js file.