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

简介: 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
相关文章
|
9月前
|
Web App开发 缓存 前端开发
VUE-CLI可选的配置文件vue.config.js
VUE-CLI可选的配置文件vue.config.js
106 0
|
5月前
|
JavaScript 前端开发
一个js里可以有多少个async function,如何用最少的async function实现多个异步操作
在 JavaScript 中,可以通过多种方法实现多个异步操作并减少 `async` 函数的数量。
|
6月前
|
SQL JavaScript 前端开发
【Azure 应用服务】Azure JS Function 异步方法中执行SQL查询后,Callback函数中日志无法输出问题
【Azure 应用服务】Azure JS Function 异步方法中执行SQL查询后,Callback函数中日志无法输出问题
102 0
|
7月前
|
存储 JSON JavaScript
【Python】已完美解决:TypeError: the JSON object must be str, bytes or bytearray, not dict
【Python】已完美解决:TypeError: the JSON object must be str, bytes or bytearray, not dict
391 1
|
7月前
|
JSON 前端开发 数据格式
【Python】已解决:TypeError: Object of type JpegImageFile is not JSON serializable
【Python】已解决:TypeError: Object of type JpegImageFile is not JSON serializable
137 0
|
7月前
|
开发者 Python
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
【Python】已解决:TypeError: descriptor ‘index‘ for ‘list‘ objects doesn‘t apply to a ‘str‘ object
192 0
|
7月前
|
开发者 Python
【Python】已解决:TypeError: a bytes-like object is required, not ‘int’
【Python】已解决:TypeError: a bytes-like object is required, not ‘int’
379 0
|
7月前
|
JavaScript API
若依没解构送post请求出现的bug,vue.runtime.esm.js:620 [Vue warn]: Error in mounted hook: “TypeError: (0 , _inde
若依没解构送post请求出现的bug,vue.runtime.esm.js:620 [Vue warn]: Error in mounted hook: “TypeError: (0 , _inde
|
9月前
|
存储 JavaScript 前端开发
js开发:请解释什么是回调函数(callback function),并给出一个示例。
回调函数是JavaScript中处理异步编程的一种常见模式,常用于事件驱动和I/O操作。它们作为参数传递给其他函数,在特定条件满足或任务完成后被调用。例如,`asyncOperation`函数接受回调函数`handleResult`,在模拟的异步操作完成后,调用`handleResult`并传递结果。这使得程序员能在操作完成后执行后续任务。
90 1
|
9月前
|
JavaScript
Vue子组件调用父组件方法并传参的5种方式:$emit触发、传入子组件function、访问父组件$parent.function、用inject关联父组件provide的方法、用window.fun
Vue子组件调用父组件方法并传参的5种方式:$emit触发、传入子组件function、访问父组件$parent.function、用inject关联父组件provide的方法、用window.fun

热门文章

最新文章