Chrome does not trigger the “onerror” event if images are disabled in the browser

I’m showing the spinner while the image is loading. After the image loading is completed or if an image loading error occurs, the spinner must be hidden. But due to the fact that the onerror event is not triggered in Google Chrome, if the images are disabled in the browser, the spinner remains visible.

Everything works in firefox.