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”

相关文章
|
4月前
|
前端开发 JavaScript
VUE——Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
VUE——Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
107 0
|
7月前
|
前端开发
使用ffmpeg-core的时候报错,解决Uncaught (in promise) ReferenceError: SharedArrayBuffer is not defined
使用ffmpeg-core的时候报错,解决Uncaught (in promise) ReferenceError: SharedArrayBuffer 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兼容性问题
473 0
|
7月前
|
API iOS开发 MacOS
WAServiceMainContext.js:2 ReferenceError: result is not defined
WAServiceMainContext.js:2 ReferenceError: result is not defined
57 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
231 0
|
7月前
|
JavaScript 前端开发
Vue报错“ Uncaught TypeError: Cannot read property ‘use‘ of undefined”
Vue报错“ Uncaught TypeError: Cannot read property ‘use‘ of undefined”
411 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 等等
210 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
130 0
Vue3引入element-ui报错:Uncaught TypeError: Cannot read property ‘prototype‘ of undefined
配置无误、代码未报错,运行时页面空白,F12控制台报错: Uncaught TypeError: Cannot read property ‘prototype’ of undefined
388 0
|
JavaScript
vue路由跳转报错Uncaught SyntaxError:Unexpected token ‘<‘ (at chunk-elementUI.aeed1b74.js:1:1)Uncaught Synt
vue路由跳转报错Uncaught SyntaxError:Unexpected token ‘<‘ (at chunk-elementUI.aeed1b74.js:1:1)Uncaught Synt
822 0