1 Cannot set property ‘errorHandler’ of undefined
前端报错
Uncaught TypeError: Cannot set property ‘errorHandler’ of undefined
样例分析
errorHandle
r 是vue.config对象上的属性
但在使用Vue.config
未初始化为对象,导致操作报错。
解决方法
初始化Vue.config
为对象
2 UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token ‘??=’
前端报错
(node:18376) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token ‘??=’
样例分析
逻辑空赋值(??=)是ES2021的语法,node v15.0.0以上才支持逻辑空赋值(??=)的语法
解决方法
使用nvm切换15以上版本的node,成功解决