I load Firebase js library with RequireJS like this:
require([
\'firebase-app\',
\'firebase-storage\'
], function (firebase) {
firebase.initializeApp
Found the solution at this page (valid only for firebase release >= 5.5.6):
https://github.com/firebase/firebase-js-sdk/issues/1266#issuecomment-441405513
you must call firebase.app.js like "@firebase/app", so:
var config = {
paths: {
'@firebase/app': 'https://www.gstatic.com/firebasejs/5.7.1/firebase-app',
'@firebase/storage': 'https://www.gstatic.com/firebasejs/5.7.1/firebase-storage'
}
};
require([
'@firebase/app',
'@firebase/storage'
], function (firebase) {
firebase.initializeApp({
...
});
firebase.storage();
});
final jsfiddle: https://jsfiddle.net/ptmw0srq/125/