Vue报错:Error in v-on handler: “ReferenceError: regeneratorRuntime is not defined“

简介: Vue报错:Error in v-on handler: “ReferenceError: regeneratorRuntime is not defined“

项目中使用了async/await

Vue报错:Error in v-on handler: 
"ReferenceError: regeneratorRuntime is not defined"

原因:

项目中没有使用transform-runtime将es6换成es5

解决方法:

安装transform-runtime

npm i babel-plugin-transform-runtime -D

配置:.babelrc

"plugins": [
    "transform-runtime"
]

参考

Vue报错:Error in v-on handler: “ReferenceError: regeneratorRuntime is not defined”

相关文章
|
中间件
解构如何运用的解构--报错 throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
解构如何运用的解构--报错 throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
解构如何运用的解构--报错 throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
成功解决:Error in created hook: “ReferenceError: params is not defined“
该博客文章描述了作者解决"ReferenceError: params is not defined"错误的过程,原因是路由传递的params参数与调用方法中的参数名称冲突,最终通过检查接口参数解决了问题。
成功解决:Error in created hook: “ReferenceError: params is not defined“
Uncaught runtime errors: × ERROR Cannot read properties of undefined (reading ‘ vue2&vue-router兼容性问题
Uncaught runtime errors: × ERROR Cannot read properties of undefined (reading ‘ vue2&vue-router兼容性问题
454 0
|
7月前
|
API iOS开发 MacOS
WAServiceMainContext.js:2 ReferenceError: result is not defined
WAServiceMainContext.js:2 ReferenceError: result is not defined
55 0
|
7月前
|
JavaScript 前端开发
[Vue warn]: Error in v-on handler (Promise/async): “NavigationDuplicated: Navigating to current loca
[Vue warn]: Error in v-on handler (Promise/async): “NavigationDuplicated: Navigating to current loca
212 0
|
7月前
|
JavaScript 前端开发
Vue报错“ Uncaught TypeError: Cannot read property ‘use‘ of undefined”
Vue报错“ Uncaught TypeError: Cannot read property ‘use‘ of undefined”
389 1
|
7月前
|
JavaScript
vue ssr 报错 ReferenceError: MouseEvent is not defined / window is not defined 等等
vue ssr 报错 ReferenceError: MouseEvent is not defined / window is not defined 等等
202 0
|
JavaScript
Echarts报错-Uncaught ReferenceError: echarts is not defined
Echarts报错-Uncaught ReferenceError: echarts is not defined
431 0
|
人工智能 自然语言处理 JavaScript
vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in created hook: “TypeError: Object(...) is not a func
vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in created hook: “TypeError: Object(...) is not a func
126 0
Vue3引入element-ui报错:Uncaught TypeError: Cannot read property ‘prototype‘ of undefined
配置无误、代码未报错,运行时页面空白,F12控制台报错: Uncaught TypeError: Cannot read property ‘prototype’ of undefined
376 0
下一篇
DataWorks