{"action":"created","issue":{"url":"https://api.github.com/repos/zurb/foundation-sites/issues/8196","repository_url":"https://api.github.com/repos/zurb/foundation-sites","labels_url":"https://api.github.com/repos/zurb/foundation-sites/issues/8196/labels{/name}","comments_url":"https://api.github.com/repos/zurb/foundation-sites/issues/8196/comments","events_url":"https://api.github.com/repos/zurb/foundation-sites/issues/8196/events","html_url":"https://github.com/zurb/foundation-sites/issues/8196","id":134643563,"number":8196,"title":"component.destroy() causes error on route change (Meteor)","user":{"login":"merlinpatt","id":421960,"avatar_url":"https://avatars.githubusercontent.com/u/421960?v=3","gravatar_id":"","url":"https://api.github.com/users/merlinpatt","html_url":"https://github.com/merlinpatt","followers_url":"https://api.github.com/users/merlinpatt/followers","following_url":"https://api.github.com/users/merlinpatt/following{/other_user}","gists_url":"https://api.github.com/users/merlinpatt/gists{/gist_id}","starred_url":"https://api.github.com/users/merlinpatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlinpatt/subscriptions","organizations_url":"https://api.github.com/users/merlinpatt/orgs","repos_url":"https://api.github.com/users/merlinpatt/repos","events_url":"https://api.github.com/users/merlinpatt/events{/privacy}","received_events_url":"https://api.github.com/users/merlinpatt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zurb/foundation-sites/labels/meteor","name":"meteor","color":"eeeeee"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-18T17:30:57Z","updated_at":"2016-02-18T17:43:19Z","closed_at":null,"body":"Whenever I change routes in Meteor, I get the below stack trace. From what I can tell, the error happens because the `destroy` call queued and then it is attempting to destroy a plugin which is no longer on the page. This is a huge problem because `Foundation._uuids` array is not being emptied and various nodes are still attached to the DOM\r\n\r\n```\r\nException in queued task: TypeError: Cannot read property 'constructor' of undefined\r\n    at Object.Foundation.unregisterPlugin (http://localhost:3000/packages/zurb_foundation-sites.js?f0d625ccde0bd87f0af3d3f80f920d2e7cd06fe3:245:79)\r\n    at Tooltip.destroy (http://localhost:3000/packages/zurb_foundation-sites.js?f0d625ccde0bd87f0af3d3f80f920d2e7cd06fe3:7925:16)\r\n    at null.<anonymous> (http://localhost:3000/packages/merlin_foundation-blaze.js?063e3082187e3afe260f9d9941366a764e33e887:136:15)\r\n    at http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:3338:22\r\n    at Function.Template._withTemplateInstanceFunc (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:3679:12)\r\n    at fireCallbacks (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:3334:12)\r\n    at null.<anonymous> (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:3440:5)\r\n    at fireCallbacks (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:1960:26)\r\n    at Object.Tracker.nonreactive (http://localhost:3000/packages/tracker.js?7776276660c988c38fed448d8262b925dffb5bc3:615:12)\r\n    at http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:1957:13\r\n```"},"comment":{"url":"https://api.github.com/repos/zurb/foundation-sites/issues/comments/185830115","html_url":"https://github.com/zurb/foundation-sites/issues/8196#issuecomment-185830115","issue_url":"https://api.github.com/repos/zurb/foundation-sites/issues/8196","id":185830115,"user":{"login":"juliancwirko","id":4427985,"avatar_url":"https://avatars.githubusercontent.com/u/4427985?v=3","gravatar_id":"","url":"https://api.github.com/users/juliancwirko","html_url":"https://github.com/juliancwirko","followers_url":"https://api.github.com/users/juliancwirko/followers","following_url":"https://api.github.com/users/juliancwirko/following{/other_user}","gists_url":"https://api.github.com/users/juliancwirko/gists{/gist_id}","starred_url":"https://api.github.com/users/juliancwirko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliancwirko/subscriptions","organizations_url":"https://api.github.com/users/juliancwirko/orgs","repos_url":"https://api.github.com/users/juliancwirko/repos","events_url":"https://api.github.com/users/juliancwirko/events{/privacy}","received_events_url":"https://api.github.com/users/juliancwirko/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T17:43:19Z","updated_at":"2016-02-18T17:43:19Z","body":"Do you check if the element still exists before destroing it? Like here: https://atmospherejs.com/zurb/foundation-sites#javascript-part\r\n\r\nHard to say with only this stack trace. \r\nCould you provide some kind of reproduction repo or code examples?"}}