question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image from url loads with https but fails loading with http

See original GitHub issue

I am trying to display a simple image from an URL in the iOS Simulator. When the URL is a https domain it works fine but when I try loading from a http domain the image is not loaded. Via the inspector you can see that a blank image was created. My code is the following: render() { return ( <View> <Image source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}} // source={{uri: 'http://facebook.github.io/react/img/logo_og.png'}} style={{width: 400, height: 400}} onLoadStart={() => console.warn('loading started')} onLoad={() => console.warn('loading successful')} onLoadEnd={() => console.warn("loading endet (successful or not")} /> </View> ); }

I already tried:

  • Restarting the packager and the iOS simulator (no change)
  • Reset Contents and Settings of the iOS simulator (no change)
  • Tried several other images via http and https
  • Created new project from scratch via react-native init myurltestproject` and added code from above (still not working for http images)

I am using:

  • react-native-cli: 1.0.0
  • react-native: 0.28.0
  • macOS 10.10.5 (Yosemite)
  • MacBook Pro 13inch early 2015

Side note: Interestingly when I try to run the exact same code on the simulator but via Deco IDE (Version 1.1.2 (0.7.0)) http and https url are working.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
aartivazcommented, May 24, 2018

Our is not working with https in Android. Can you please tell us how was your working on Android?

3reactions
gitlovenotwarcommented, May 30, 2017

Any solution for loading the images over http?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the HTTPS Links to HTTP Image Error - Sitechecker
The error means that there are images loaded over insecure HTTP connections when you request an initial Hypertext Transfer Protocol Secure ...
Read more >
Image loading from https:// protocol but not loading from http ...
The recommended solution is to move all of your traffic to HTTPS. Share. Share a link to this answer. Copy link
Read more >
Images not loading when using https | WordPress.org
When accessing my site with http, all images load normally. When accessing the site with https, 99% of images will not load. 1)...
Read more >
Switching from Http to Https, but what about images and ... - Moz
Hi Ya'll. I'm transitioning our http version website to https. Important question: Do images have to have 301 redirects? If so, how and...
Read more >
Mixed content (loads HTTP resources on HTTPS URL) - Sitebulb
This means that the URL in question is loaded over a secure HTTPS protocol, but some other resources (such as images, videos, stylesheets,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found