{"id":1193,"date":"2022-08-30T15:13:56","date_gmt":"2022-08-30T15:13:56","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/backbone-error-cannot-read-property-c18-of-undefined-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:13:56","modified_gmt":"2022-08-30T15:13:56","slug":"backbone-error-cannot-read-property-c18-of-undefined-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/backbone-error-cannot-read-property-c18-of-undefined-collection-of-common-programming-errors\/","title":{"rendered":"Backbone error, Cannot read property &#39;c18&#39; of undefined-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m making a massive multi page backbone site.<\/p>\n<p>I&#8217;m sometimes re-using collections and views across multiple pages of the site, as if they were controls. I&#8217;ve now done something which is coming up with errors like this,<\/p>\n<p>Cannot read property &#8216;c18&#8217; of undefined<\/p>\n<p>At the moment, the c18 is always the same.<\/p>\n<p>I&#8217;m also using backbone relational.<\/p>\n<p>Any ideas anyone?<\/p>\n<ol>\n<li>\n<p>I had weird errors happening when a view was closed before it finished rendering. In your case, it could be that a model was removed before a view finished rendering.<\/p>\n<p>In the future, you could debug this by hacking the Backbone code and printing the CID on View and Model initialization (in the constructor). At least this way you&#8217;d know what type of object c18 is.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:08:27. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m making a massive multi page backbone site. I&#8217;m sometimes re-using collections and views across multiple pages of the site, as if they were controls. I&#8217;ve now done something which is coming up with errors like this, Cannot read property &#8216;c18&#8217; of undefined At the moment, the c18 is always the same. I&#8217;m also using [&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-1193","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1193","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=1193"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1193\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}