Vue:Uncaught TypeError Object(...) is not a function at resetStoreState (vuex.esm-browser.js55021

Posted 流楚丶格念

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Vue:Uncaught TypeError Object(...) is not a function at resetStoreState (vuex.esm-browser.js55021相关的知识,希望对你有一定的参考价值。

原因:Vue 2.x和Vuex 4.x版本不对应

Vue 3 匹配Vuex 4 ,Vue 2 匹配Vuex 3

问题

浏览器控制台报错

Uncaught TypeError: Object() is not a function
at resetStoreState (vuex.esm-browser.js5502:140:1)
at new Store (vuex.esm-browser.js5502:932:1)
at eval (index.js4360:48:1)
at Module/src/store/index.js (index.js:1115:1)
at __webpack_require__ (index.js:849:30)
at fn (index.js:151:20)
at eval (main.js:13:64)
at Module/src/main.js (index.js:1103:1)
at __webpack_require__ (index.js:849:30)
at fn (index.js:151:20)

vuex源码报错

google浏览器源代码

store._state = reactive(
	data: state
);

解决

npm先卸载Vuex 4.xx

npm uninstall vuex --save

安装Vuex 3.xx

npm install vuex@3 --save

以上是关于Vue:Uncaught TypeError Object(...) is not a function at resetStoreState (vuex.esm-browser.js55021的主要内容,如果未能解决你的问题,请参考以下文章

Vue Uncaught TypeError:fn.bind 不是函数

vue控制台报 Uncaught (in promise) TypeError:

Uncaught TypeError: $props.currentQuestion is undefined Vue

解决vue3 vue-pdf报错Uncaught (in promise) TypeError: h is not a function

解决vue3 vue-pdf报错Uncaught (in promise) TypeError: h is not a function

解决vue3 vue-pdf报错Uncaught (in promise) TypeError: h is not a function