vuex-ts-decorators icon indicating copy to clipboard operation
vuex-ts-decorators copied to clipboard

[vuex] must call Vue.use(Vuex) before creating a store instance

Open roblav96 opened this issue 7 years ago • 5 comments

This one's weird :/

vuex.esm.js:96 Uncaught Error: [vuex] must call Vue.use(Vuex) before creating a store instance.
    at assert (vuex.esm.js:96)
    at new Store (vuex.esm.js:243)
    at Object.Event.initEvent.cancelable.type (module.ts:6)
    at __webpack_require__ (bootstrap d48f772…:19)
    at Object.<anonymous> (action.ts:28)
    at __webpack_require__ (bootstrap d48f772…:19)
    at Object.exports.byteLength (chart.ts:21)
    at __webpack_require__ (bootstrap d48f772…:19)
    at Object.<anonymous> (net.busy.ts:13)
    at __webpack_require__ (bootstrap d48f772…:19)

It's coming from module.ts:6 but it clearly does call Vue.use(Vuex); before that.

roblav96 avatar Apr 15 '17 04:04 roblav96

Thanks @roblav96! I'm currently in the middle of a slight refactor that will change things a bit (for the better) will keep you posted.

snaptopixel avatar Apr 16 '17 14:04 snaptopixel

@snaptopixel Awesome! I'm very excited to see more out of this. Thanks mate!

roblav96 avatar Apr 16 '17 19:04 roblav96

Is this related at all to how the imports are done?

With latest Vue changes we're now supposed to import in TS like so:

import Vue from 'vue';
import Vuex from 'vuex';

hworld avatar Apr 19 '17 18:04 hworld

@hworld Yes you are correct. You can no longer do import * as Vue from 'vue'

roblav96 avatar Apr 20 '17 12:04 roblav96

Thanks @roblav96 I'm close to finished with the refactor and will be releasing as a new project soon. I will keep you posted!

snaptopixel avatar Nov 21 '17 18:11 snaptopixel