javascript - Angular 5 : Error: macroTask 'requestAnimationFrame'

标签 javascript angular

使用 polyfills.jsvideo.js加载视频后,控制台此错误:

Error: macroTask 'requestAnimationFrame': can not transition to 'running', expecting state 'scheduled', was 'notScheduled'.



我正在寻找解决此错误的方法,顺便说一句,视频正在播放,除了显示此错误之外没有其他问题。

最佳答案

在您的src/polyfills.ts 内添加这一行

(window as any).__Zone_disable_requestAnimationFrame = true;
可能需要重新运行ng serve如果在本地运行。
请注意,如果您在其他地方或在 angular/components 等 Angular 库中使用 requestAnimationFrame,则可能会导致更改检测问题

关于javascript - Angular 5 : Error: macroTask 'requestAnimationFrame' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48790499/

相关文章:

Angular 路由器 : Redirect to an i18n URL

javascript - 如何在window.open方法中传递参数?

javascript - 如何在 JavaScript 中从数组中选择多个参数(jQuery.path)

javascript - 是否可以 Hook 任何内联 css 更改

javascript - 使用 javascript 清除 cookie

带有 primeng fullcalendar 的 angular9 抛出错误 : Cannot find namespace 'FullCalendarVDom' . 和 'Please import the top-level fullcalendar lib'

javascript - 远离现有内容

javascript - typescript 导入模块作为变量不起作用

angular - Observable.catch() 和 RxJ 中的异常处理

javascript - 线性渐变在 Outlook 中不起作用