【报错】unhandled error during execution of watcher callback

简介: JavaScript错误`unhandled error during execution of watcher callback`在Echarts图表渲染时出现,通常是因数据未获取到就尝试渲染导致。解决方法是在渲染前添加非空判断,如`if(value){开始渲染数据}`或`if(value !== undefined){开始渲染数据}`,确保数据加载完成后再执行渲染。

@[toc]

报错

unhandled error during execution of watcher callback

分析

在使用Echarts图标绘制数据时,报错:unhandled error during execution of watcher callback,提示的原因是因为当年数据还未拿到时就开始渲染Echarts图表,导致图表展现不出来报错

解决

在数据渲染之前先做一下非空判断
例如:

if(value){
    开始渲染数据
}

if(value !== undefined){
    开始渲染数据
}
相关文章
|
1月前
|
Web App开发 存储 移动开发
Uncaught (in promise) DOMException: The play() request was interrupted by a new load request.异常处理
Uncaught (in promise) DOMException: The play() request was interrupted by a new load request.异常处理
108 0
|
1月前
|
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
60 0
|
7月前
|
前端开发
【JCEF】关于-1 The query has been canceled或Unexpected call to CefQueryCallback_N::finalize()错误
【JCEF】关于-1 The query has been canceled或Unexpected call to CefQueryCallback_N::finalize()错误
73 0
|
1月前
|
安全
Error:Execution failed for task ':transformClassesAndResourcesWithProguardForRelease'
Error:Execution failed for task ':transformClassesAndResourcesWithProguardForRelease'
16 0
npm 启动报错 解决 events.js:174 throw er; // Unhandled 'error' event 的报错问题
npm 启动报错 解决 events.js:174 throw er; // Unhandled 'error' event 的报错问题
npm 启动报错 解决 events.js:174 throw er; // Unhandled 'error' event 的报错问题
|
1月前
【报错】unhandled error during execution of watcher callback
【报错】unhandled error during execution of watcher callback
|
10月前
|
Java Maven Android开发
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
|
7月前
|
前端开发 JavaScript
Uncaught (in promise) Error: Request failed with status code 500
Uncaught (in promise) Error: Request failed with status code 500
336 0
|
10月前
throw new MongooseError(‘Mongoose.prototype.connect() no longer accepts a callback‘);
throw new MongooseError(‘Mongoose.prototype.connect() no longer accepts a callback‘);
103 1