0π
β
It turned out to be a circular dependency in the end. Even if i didnβt belive in it for most of the time.
DocumentImageStore
β DocumentImageService
β ServiceBase
β NotificationStore
.
As DocumentImageStore
and NotificationStore
resolve from the same vuex-store, in some case the dependency seems not to get resolved, while in other it does (I guess depending on which gets asked for first).
I resolved it by creating a lazy import for the NotificationStore
in the Service:
const getStore = () => import("./../store");
export const createNotification = function(message) {
getStore().then(store => {
store.default.dispatch("notificationStore/createNotification", message)
});
}
I guess best would be to resolve the circular dependency completely, but at the current point I donβt see how to do this the way itβs implemented right now.
Source:stackexchange.com