我有以下几点:
db.collection("users")
.where("activated", "==", 0)
.get()
.then(snap => {
snap.forEach(doc => {
if (String(doc.data().profileURL) != String(defaultImageUrl)) {
var r = document.getElementById('userTable').insertRow()
r.insertCell(1).innerHTML = doc.data().age
var storageRef = firebase.storage().ref();
var temp_photo = storageRef.child('avatar/'+doc.data().profileURL+'/')
temp_photo.getDownloadURL().then(downloadURL => {
console.log("log here -> " + downloadURL);
var y = r.insertCell(2).innerHTML = '<img src="'+downloadURL+'" width="50" height="50" />';
})
}
}
}//closing braces might be off but the rest of the code works, just to this purpose
});
});所有数据显示正确,但图像没有显示,应用程序崩溃
错误:无法实例化防火墙-存储-确保首先加载firebase-app.js。(匿名函数) (firebase-storage.js:1:39246) (匿名函数) (firebase-storage.js:1:165)全局代码(firebase-storage.js:1:188)错误未处理的承诺拒绝: TypeError: firebase.storage不是函数。(在“firebase.storage()”中)“firebase.storage”是未定义的)(匿名函数) (toActivate.js:39) (匿名函数)(firebase firestore.js:1:278233)(匿名函数)(firebase firestore.js:1:64792)(匿名函数)(firebase firestore.js:1:58068)(匿名函数)(firebase firestore.js:1:58062)(匿名函数)(firebase firestore.js:1:58062)(匿名函数)(firebase firestore.js:1:58062)(匿名函数)(firebase firestore.js:1:64769)(匿名函数)(firebase firestore.js:1:278214)(匿名函数) (toActivate.js:20) promiseReactionJob
在我的html中,我确实有一个存储脚本:
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.2.3/firebase-storage.js"></script>发布于 2020-10-14 16:02:24
Firebase脚本的版本需要全部匹配。您的防火墙-存储不匹配的防火墙-应用程序。根据发布说明的说法,最新版本是7.23.0。
https://stackoverflow.com/questions/64357194
复制相似问题