Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GET gs://example.appspot.com/images net::ERR_UNKNOWN_URL_SCHEME

I've been getting this error message lately and I wonder why.

GET gs://example.appspot.com/images net::ERR_UNKNOWN_URL_SCHEME

Below are my references to the storage service:

var storage = firebase.storage();

var storageRef = storage.ref();

var storageRefImgs = storageRef.child('images');

I have Google Chrome 51 and I'm running Windows 10.

like image 630
M'Boulas Avatar asked Dec 25 '22 04:12

M'Boulas


1 Answers

It seems like you're putting the gs:// URL (which is an internal Google Storage reference) into a control that can't handle it (such as an img tag).

If you want to use the file in an img tag, you'll have to get the download URL for the file. From the documentation:

storageRef.child('images/stars.jpg').getDownloadURL().then(function(url) {
  // Get the download URL for 'images/stars.jpg'
  // This can be inserted into an <img> tag
  // This can also be downloaded directly
}).catch(function(error) {
  // Handle any errors
});
like image 112
Frank van Puffelen Avatar answered Dec 26 '22 19:12

Frank van Puffelen