0

Sometimes when I load my website, this message appears in the console:

enter image description here

Why is this shown? Aren't my JS code optimized enough? And what should I do now?

Martin AJ
  • 6,261
  • 8
  • 53
  • 111
  • Possible duplicate of [Violation Long running JavaScript task took xx ms](https://stackoverflow.com/questions/41218507/violation-long-running-javascript-task-took-xx-ms) – Curiousdev Jun 03 '17 at 18:28
  • https://gist.github.com/paulirish/5d52fb081b3570c81e3a – apokryfos Jun 03 '17 at 18:30

2 Answers2

0

reflow is the name of the web browser process for re-calculating the positions and geometries of elements in the document, for the purpose of re-rendering part or all of the document.

Your Browser stops the execution of the script because reflow is user-blocking

Take a look at this List of what operations force reflow: https://gist.github.com/paulirish/5d52fb081b3570c81e3a

Luca Kiebel
  • 9,790
  • 7
  • 29
  • 44
0

You can read all about it here.

Violation Long running JavaScript task took xx ms

See the answers to get to know what it is and why the warning shows up.

To trace the cause, I would recommend you employ Binary search technique and keep dividing your java-script code and commenting them till you get to the line/lines which are causing this problem.