Failed to load resource under Chrome

685,899

Solution 1

I recently ran into this problem and discovered that it was caused by the "Adblock" extension (my best guess is that it's because I had the words "banner" and "ad" in the filename).

As a quick test to see if that's your problem, start Chrome in incognito mode with extensions disabled (ctrl+shift+n) and see if your page works now. Note that by default all extensions will be already disabled in incognito mode unless you've specifically set them to run (via chrome://extensions).

Solution 2

Check the network tab to see if Chrome failed to download any resource file.

Solution 3

In case it helps anyone, I had this exact same problem and discovered that it was caused by the "Do Not Track Plus" Chrome Extension (version 2.0.8). When I disabled that extension, the image loaded without error.

Solution 4

There is also the option of turning off the cache for network resources. This might be best for developing environments.

  1. Right-click chrome
  2. Go to 'inspect element'
  3. Look for the 'network' tab somewhere at the top. Click it.
  4. Check the 'disable cache' checkbox.

Solution 5

Kabir's solution is correct. My image URL was

/images/ads/homepage/small-banners01.png, 

and this was tripping up AdBlock. This wasn't a cross-domain issue for me, and it failed on both localhost and on the web.

I was using Chrome's network tab to debug and finding very confusing results for these specific images that failed to load. The first request would return no response (Status "(pending)"). Later down the line, there was a second request that listed the original URL and then "Redirect" as the Initiator. The redirect request headers were all for this identical short line of base64-encoded data, and each returned no response, although the status was "Successful":

GET      data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg== HTTP/1.1

Later I noticed that these inline styles were added to all the image elements:

    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;

Finally, I did not receive any "failed to load resource" messages in the console, but rather this:

Port error: Could not establish connection. Receiving end does not exist.

If any of these things is happening to you, it probably has something to do with AdBlock. Turn it off and/or rename your image files.

Also, because of the inline CSS created by AdBlock, the layout of my promotions slider was being thrown off. While I was able to fix the layout issues with CSS before finding Kabir's solution, the CSS was somewhat unnecessary and affected the flexibility of the slider to handle images of multiple sizes.

I guess the lesson is: Be careful what you name your images. These images weren't malicious or annoying as much as they were alerting visitors to current promotions and specials in an unobtrusive way.

Share:
685,899

Related videos on Youtube

AntonAL
Author by

AntonAL

Качественная разработка сайтов для компаний, товаров и услуг. Development of quality websites for companies, products and services.

Updated on May 28, 2021

Comments

  • AntonAL
    AntonAL about 3 years

    There is a bunch of images in a web page.

    Other browsers do download them correctly, but Chrome doesn't.

    In the developer's console, it shows the following message for each image:

    Failed to load resource

    As mentioned before, problem appears only in Chrome.

    What is it?

  • Janik Zikovsky
    Janik Zikovsky almost 12 years
    Yes that's it! Mine had "Popup" in the name and this was causing the issue.
  • Sam Doidge
    Sam Doidge over 11 years
    Thankyou. localhost site was fine, once on a live url the issue appeared, had me thinking..
  • heyomi
    heyomi about 11 years
    Thanks! I spent over 30mins trying to figure out why my code didn't work in Chrome.
  • amomin
    amomin about 11 years
    Thanks, I appeared to be having a similar problem (where certain images would display on some computers but not others - xbrowser in at least a few cases). I never isolated the precise problem but removing tokens "ad" and "banner" from url strings seems to have done the trick. Perhaps in my case there is some software which edits content from urls matching certain criteria before it even gets to the browser? In any case, the tip to watch out for these words in the filename was very helpful.
  • stephenkelzer
    stephenkelzer over 9 years
    Just one more reason adBlock shouldn't exist.
  • Amit
    Amit about 9 years
    Thanks for saving me. I had 'Ad' word in my url. When i removed, it worked. But, is there any workaround for this? I mean, I don't want to change my url.
  • Kabir Sarin
    Kabir Sarin about 9 years
    The extension is blocking anything with the word "Ad" in it. Either change the url, or stop using the extension. If there was a workaround, Adblock wouldn't be very useful, now would it? ;)
  • marcostrama
    marcostrama about 9 years
    Suddenly the "+1" in the content length begins to cause "Invalid Chunk Header" in my communication with Tomcat (i use php java bridge to comunicate apache with tomcat). I removed this "+1" and it became to work normally in Chrome. The error with chunk disapeared too. Strange issue... I dont figure out what happened.
  • moeabdol
    moeabdol almost 9 years
    Yes! Its being block. However, I'm serving Disqus comments in my web application. Is there a workaround to unblock these resources for my users?
  • Yokesh Varadhan
    Yokesh Varadhan over 7 years
    could u check this once stackoverflow.com/questions/42693371/… @john ktejik
  • JayJay123
    JayJay123 over 7 years
    This did it for me.
  • Clindo
    Clindo almost 7 years
    For me this was the problem :)
  • TheCrazyProfessor
    TheCrazyProfessor almost 6 years
    I have this issue too, but I doesn't have any extension installed and running the newest version, what todo?
  • Coty Embry
    Coty Embry over 4 years
    adBlock should exist and must live on
  • Sharkboots
    Sharkboots over 4 years
    With this resolving a particular issue for me. It does so only for the developers. How do I take this knowledge and release it into production so that the user is not experiencing this issue anymore. Does this just mean the onclick that's giving me this error should be clearing the cache each time or something along those lines?
  • Hello
    Hello over 4 years
    You saved me a lot of time. I tried your 1,2 and 4 nut not 4. Now I checked the 'disable cache' checkbox, there is a lot of differences.
  • cogdog
    cogdog almost 3 years
    Thanks this solved for me on failed uploads of audio files that were below the file size limit. Every upload for had failed until I disabled this cache setting.
  • cogdog
    cogdog almost 3 years
    Actually this only worked once, and failed twice again today. My solution was switching to Firefox. Upload worked on first try.