snaptopixel / vuex-ts-decorators

Write Vuex stores and modules with type-safety and code completion
52 stars 4 forks source link

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

Open roblav96 opened 7 years ago

roblav96 commented 7 years ago

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.

snaptopixel commented 7 years ago

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.

roblav96 commented 7 years ago

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

hworld commented 7 years ago

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';
roblav96 commented 7 years ago

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

snaptopixel commented 6 years ago

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