Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular5: Error: macroTask 'requestAnimationFrame'

Using polyfills.js and video.js after loading video, consoles this error :

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

I am looking for a way to resolve this error, btw video is playing and and there is no other problem except showing this error.

like image 930
vladanPro Avatar asked Feb 14 '18 15:02

vladanPro


1 Answers

Inside your src/polyfills.ts add this line

(window as any).__Zone_disable_requestAnimationFrame = true;

may need to re-run ng serve if running locally.

Note that if you're using requestAnimationFrame elsewhere or in an angular library such as angular/components it may cause change detection issues

like image 198
glued Avatar answered Sep 25 '22 13:09

glued