nigeltiany/vue-socket-cluster

Error in beforeDestroy hook

dotbloup opened this issue · 1 comments

Hi,
i get the following error, when i leave a page on which there is a component with vue socket cluster listener in it. It looks like there is some logic that is executed when beforeDestroy() is executed.

[Vue warn]: Error in beforeDestroy hook: "TypeError: Cannot read property 'set' of undefined"

found in

---> at src/views/botlist/seoscanmissmix.vue

at src/container/Full.vue

at src/App.vue

warn @ vue.esm.js?efeb:574
logError @ vue.esm.js?efeb:1695
globalHandleError @ vue.esm.js?efeb:1690
handleError @ vue.esm.js?efeb:1679
callHook @ vue.esm.js?efeb:2876
Vue.$destroy @ vue.esm.js?efeb:2656
destroy @ vue.esm.js?efeb:4075
invokeDestroyHook @ vue.esm.js?efeb:5614
patch @ vue.esm.js?efeb:5937
Vue.$destroy @ vue.esm.js?efeb:2679
destroy @ vue.esm.js?efeb:4075
invokeDestroyHook @ vue.esm.js?efeb:5614
invokeDestroyHook @ vue.esm.js?efeb:5619
invokeDestroyHook @ vue.esm.js?efeb:5619
patch @ vue.esm.js?efeb:5937
Vue.$destroy @ vue.esm.js?efeb:2679
destroy @ vue.esm.js?efeb:4075
invokeDestroyHook @ vue.esm.js?efeb:5614
invokeDestroyHook @ vue.esm.js?efeb:5619
patch @ vue.esm.js?efeb:5937
Vue.$destroy @ vue.esm.js?efeb:2679
destroy @ vue.esm.js?efeb:4075
invokeDestroyHook @ vue.esm.js?efeb:5614
removeVnodes @ vue.esm.js?efeb:5630
updateChildren @ vue.esm.js?efeb:5738
patchVnode @ vue.esm.js?efeb:5792
updateChildren @ vue.esm.js?efeb:5689
patchVnode @ vue.esm.js?efeb:5792
patch @ vue.esm.js?efeb:5952
Vue._update @ vue.esm.js?efeb:2626
updateComponent @ vue.esm.js?efeb:2744
get @ vue.esm.js?efeb:3094
run @ vue.esm.js?efeb:3171
flushSchedulerQueue @ vue.esm.js?efeb:2933
(anonymous) @ vue.esm.js?efeb:1795
flushCallbacks @ vue.esm.js?efeb:1716
module.exports @ _invoke.js?3c70:5
queue.(anonymous function) @ _task.js?49e8:35
run @ _task.js?49e8:21
listener @ _task.js?49e8:25
vue.esm.js?efeb:1699 TypeError: Cannot read property 'set' of undefined
at Emitter.removeListener (build.js?8449:3407)
at Object.deleteProperty (build.js?8449:3515)
at eval (build.js?8449:3535)
at Array.forEach ()
at eval (build.js?8449:3534)
at Array.map ()
at VueComponent.beforeDestroy (build.js?8449:3531)
at callHook (vue.esm.js?efeb:2874)
at VueComponent.Vue.$destroy (vue.esm.js?efeb:2656)
at destroy (vue.esm.js?efeb:4075)

vue.esm.js?efeb:1699 TypeError: Cannot read property 'set' of undefined
at Emitter.removeListener (build.js?8449:3407)
at Object.deleteProperty (build.js?8449:3515)
at eval (build.js?8449:3535)
at Array.forEach ()
at eval (build.js?8449:3534)
at Array.map ()
at VueComponent.beforeDestroy (build.js?8449:3531)
at callHook (vue.esm.js?efeb:2874)
at VueComponent.Vue.$destroy (vue.esm.js?efeb:2656)
at destroy (vue.esm.js?efeb:4075)

=============
To replicate it create a component.vue with something like that

export default {
  name: 'component',
  ConnectionEvents:  {
  listener(data){
}}}

Create page.vue importing the component:

import component from "./component.vue";
export default {
  components: { component },
}

Thank you so much, this helped me fix huge bugs. Update to version 1.0.3 and let me know how it goes.