You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 26, 2021. It is now read-only.
TypeError: Cannot read property 'runtime' of undefined
at ModuleCollection.unregister (node_modules/vuex/dist/vuex.common.js:219:28)
at Store.unregisterModule (node_modules/vuex/dist/vuex.common.js:512:17)
at Object.<anonymous>.module.exports (node_modules/vue-tables-2/compiled/state/register-module.js:19:17)
at Object.<anonymous>.module.exports (node_modules/vue-tables-2/compiled/mixins/created.js:9:5)
at VueComponent.created (node_modules/vue-tables-2/compiled/v-server-table.js:65:7)
After some research I figured out that users are stuck with the same problem using SSR. For example, vuejs/vue2-ssr-docs#137 (comment) . Diving deeper I discovered that It also can be rooted from the dynamic registration of the vuex module inside created hook instead of beforeCreate
If someone is interested: I defined a property in the state mock, which name was the same as registered component. But I found out, that changing condition of unregistering of the module to self.$store && self.$store.hasModule(self.name) did the trick and prevented Store.unregisterModule from being called with the name of a nonexistent module.
This fact says, that self.$store.hasModule API has more stable logic because it relies on isRegistered property.
I have a problem in my unit tests only:
After some research I figured out that users are stuck with the same problem using SSR. For example, vuejs/vue2-ssr-docs#137 (comment) . Diving deeper I discovered that It also can be rooted from the dynamic registration of the vuex module inside
created
hook instead ofbeforeCreate
Possible solutions:
vue-tables-2/lib/state/register-module.js
Line 12 in 46e4da0
I suppose it could be better to check out the existence of the registered module using https://vuex.vuejs.org/api/#hasmodule
Move the registration of the module inside
beforeCreate
instead ofcreated
These all things are just assumptions. I will try to test them and let you know if I come up with something.
The text was updated successfully, but these errors were encountered: