{"id":1487,"date":"2022-08-30T15:16:56","date_gmt":"2022-08-30T15:16:56","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/23\/ember-understand-errors-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:16:56","modified_gmt":"2022-08-30T15:16:56","slug":"ember-understand-errors-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/ember-understand-errors-collection-of-common-programming-errors\/","title":{"rendered":"ember: understand errors-Collection of common programming errors"},"content":{"rendered":"<p>It&#8217;s very difficult for me to understand ember.js errors. I always have to look at all my code and make random changes, because i can&#8217;t figure where errors are. In particular i have this error, modifying (but keeping structurally the same) the peepcode example:<\/p>\n<pre><code>Uncaught Error: Something you did caused a view to re-render after it rendered but \n\nbefore it was inserted into the DOM. application.js:30508\nEmber.merge.rerender application.js:30508\nEmber.View.Ember.CoreView.extend.rerender application.js:29198\nEmber.View.Ember.CoreView.extend._controllerDidChange application.js:29117\nsendEvent application.js:18480\nEmber.notifyObservers application.js:17033\npropertyDidChange application.js:17640\niterDeps application.js:17089\ndependentKeysDidChange application.js:17113\npropertyDidChange application.js:17638\nset application.js:16460\nEmber.View.Ember.CoreView.extend.createChildView application.js:30079\nEmber.ContainerView.Ember.View.extend.init application.js:30944\nsuperWrapper application.js:15393\nEmber._Metamorph.Ember.Mixin.create.init application.js:32704\nsuperWrapper application.js:15393\nClass application.js:24583\nMixin.create.create application.js:24842\nEmber.View.Ember.CoreView.extend.createChildView application.js:30063\nEmber.merge.appendChild application.js:30517\nEmber.View.Ember.CoreView.extend.appendChild application.js:29931\nEmberHandlebars.ViewHelper.Ember.Object.create.helper application.js:33864\nget application.js:34043\nget application.js:38247\nEmberHandlebars.registerHelper.context application.js:33224\nprogram1 application.js:49634\n(anonymous function) application.js:14488\nEmber.View.Ember.CoreView.extend.render application.js:29173\nEmber.CoreView.Ember.Object.extend._renderToBuffer application.js:28180\nEmber.View.Ember.CoreView.extend._renderToBuffer application.js:29728\nsuperWrapper application.js:15393\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28159\nEmber.Instrumentation.instrument application.js:15703\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28158\nEmber.ContainerView.Ember.View.extend.render application.js:30985\nEmber.View.Ember.CoreView.extend.forEachChildView application.js:29412\nEmber.ContainerView.Ember.View.extend.render application.js:30984\nsuperWrapper application.js:15393\nEmber.CoreView.Ember.Object.extend._renderToBuffer application.js:28180\nEmber.View.Ember.CoreView.extend._renderToBuffer application.js:29728\nsuperWrapper application.js:15393\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28159\nEmber.Instrumentation.instrument application.js:15703\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28158\nEmber.merge.appendChild application.js:30520\nEmber.View.Ember.CoreView.extend.appendChild application.js:29931\nEmberHandlebars.ViewHelper.Ember.Object.create.helper application.js:33864\nget application.js:34043\nhandlebarsGet application.js:34260\nEmber.Handlebars.registerHelper.template application.js:34684\nanonymous application.js:49660\n(anonymous function) application.js:14452\nEmber.View.Ember.CoreView.extend.render application.js:29173\nEmber.CoreView.Ember.Object.extend._renderToBuffer application.js:28180\nEmber.View.Ember.CoreView.extend._renderToBuffer application.js:29728\nsuperWrapper application.js:15393\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28159\nEmber.Instrumentation.instrument application.js:15703\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28158\nEmber.ContainerView.Ember.View.extend.render application.js:30985\nEmber.View.Ember.CoreView.extend.forEachChildView application.js:29412\nEmber.ContainerView.Ember.View.extend.render application.js:30984\nsuperWrapper application.js:15393\nEmber.CoreView.Ember.Object.extend._renderToBuffer application.js:28180\nEmber.View.Ember.CoreView.extend._renderToBuffer application.js:29728\nsuperWrapper application.js:15393\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28159\nEmber.Instrumentation.instrument application.js:15703\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28158\nEmber.merge.appendChild application.js:30520\nEmber.View.Ember.CoreView.extend.appendChild application.js:29931\nEmberHandlebars.ViewHelper.Ember.Object.create.helper application.js:33864\nget application.js:34043\nget application.js:38247\nEmberHandlebars.registerHelper.context application.js:33224\nanonymous application.js:49530\n(anonymous function) application.js:14452\nEmber.View.Ember.CoreView.extend.render application.js:29173\nEmber.CoreView.Ember.Object.extend._renderToBuffer application.js:28180\nEmber.View.Ember.CoreView.extend._renderToBuffer application.js:29728\nsuperWrapper application.js:15393\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28159\nEmber.Instrumentation.instrument application.js:15703\nEmber.CoreView.Ember.Object.extend.renderToBuffer application.js:28158\nEmber.View.Ember.CoreView.extend.createElement application.js:29570\nEmber.merge.insertElement application.js:30459\nEmber.View.Ember.CoreView.extend._insertElement application.js:29502\nRunLoop._prev application.js:18573\nEmber.handleErrors application.js:14910\ninvoke application.js:18571\ninvokeOnceTimer application.js:19016\nRunLoop._prev application.js:18573\nEmber.handleErrors application.js:14910\ninvoke application.js:18571\niter application.js:18643\nRunLoop.flush application.js:18697\nRunLoop.end application.js:18602\ntryable application.js:18806\nEmber.tryFinally application.js:15548\nEmber.run.end application.js:18809\nEmber.tryFinally application.js:15550\nEmber.run application.js:18765\nEmber.Mixin.create.init application.js:41369\nsendEvent application.js:18480\nEmber.Evented.Ember.Mixin.create.trigger application.js:24352\nDS.Model.Ember.Object.extend.trigger application.js:45189\nsuperWrapper application.js:15393\n    states.rootState.Ember.State.create.loaded.DS.State.create.materializing.DS.State.create.firstTime.DS.State.create.exit application.js:44608\n    RunLoop._prev application.js:18573\n\nEmber.handleErrors application.js:14910\ninvoke application.js:18571\ninvokeOnceTimer application.js:19016\nRunLoop._prev application.js:18573\nEmber.handleErrors application.js:14910\ninvoke application.js:18571\niter application.js:18643\nRunLoop.flush application.js:18697\nRunLoop.end application.js:18602\ntryable application.js:18806\nEmber.tryFinally application.js:15548\nEmber.run.end application.js:18809\nEmber.tryFinally application.js:15550\nEmber.run application.js:18765\nDS.RESTAdapter.DS.Adapter.extend.findAll.ajax.success application.js:49038\njQuery.Callbacks.fire application.js:1038\njQuery.Callbacks.self.fireWith application.js:1149\ndone application.js:8075\njQuery.ajaxTransport.send.callback\n<\/code><\/pre>\n<p>the error occurs then navigating typing this address (not navigating) <code>transport_documents\/2<\/code>. If i navigate to this path, instead, the error is different: the first transport document I open is ok, while navigating to the second i get <code>You can't call renderToBufferIfNeeded on a destroyed view<\/code><\/p>\n<p>Is Ember too young to implement an error handling that can make a sense for the developer, or there&#8217;s some way i can debug my code more easily?<\/p>\n<p>EDIT: here are my hbl:<\/p>\n<p>APPLICATION<\/p>\n<pre><code>\n  \n    {{outlet}}\n  \n\n<\/code><\/pre>\n<p>TRANSPORT_DOCUMENTS<\/p>\n<p>{{#each controller}} {{outlet}} {{\/each}}<\/p>\n<table class=\"table table-striped\">\n<tr>\n<th>n<\/th>\n<th>data<\/th>\n<th>Azioni<\/th>\n<\/tr>\n<tr>\n<td>{{#linkTo &#8220;transport_document&#8221; this}}{{number}}{{\/linkTo}}<\/td>\n<td>{{#linkTo &#8220;transport_document&#8221; this}}{{date}}{{\/linkTo}}<\/td>\n<td>{{#linkTo transport_document this class=&#8217;btn btn-warning btn-small&#8217;}} {{\/linkTo}}<\/td>\n<\/tr>\n<\/table>\n<p>TRANSPORT_DOCUMENT<\/p>\n<pre><code><br \/>Hello world<br \/><br \/>\n<\/code><\/pre>\n<p>ROUTER<\/p>\n<pre><code>App.Router.map -&gt;\n  @route \"index\", path: \"\/\"\n  @resource \"transport_documents\", -&gt;\n    @route 'new'\n    @resource 'transport_document', {path: \"\/:transport_document_id\"}\n\n\nApp.Router.reopen\n  location: 'history'\n\nApp.TransportDocumentsRoute = Ember.Route.extend\n  model: -&gt; App.TransportDocument.find()\n<\/code><\/pre>\n<ol>\n<li>\n<p>There are a couple of debuggers, as chrome extensions:<\/p>\n<p>ember inspector and ember extension. But they could not work, because ember is evolving faster than these plugins.<\/p>\n<p>The re-render bug is caused by an <code>outlet<\/code> wrongly inside a cycle<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-23 09:50:31. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>It&#8217;s very difficult for me to understand ember.js errors. I always have to look at all my code and make random changes, because i can&#8217;t figure where errors are. In particular i have this error, modifying (but keeping structurally the same) the peepcode example: Uncaught Error: Something you did caused a view to re-render after [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1487","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1487"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1487\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}