Skip to content

Commit 8a0118a

Browse files
committed
handle not installed case
1 parent f88232b commit 8a0118a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ class Store {
3535
// use a Vue instance to store the state tree
3636
// suppress warnings just in case the user has added
3737
// some funky global mixins
38+
if (!Vue) {
39+
throw new Error(
40+
'[vuex] must call Vue.use(Vuex) before creating a store instance.'
41+
)
42+
}
3843
const silent = Vue.config.silent
3944
Vue.config.silent = true
4045
this._vm = new Vue({

0 commit comments

Comments
 (0)