所以,我试图获取我的数据库的 videoPaths,并得到那个错误,这就是代码,我在 stackoverflow 的另一篇文章中得到它
export const getStaticProps = async () => {
let videos = [];
try {
const querySnapshot = await firebase
.firestore()
.collection('allVideos')
.get();
querySnapshot.forEach(function (doc) {
console.log(doc.data().title);
console.log(doc.data().pid);
videos.push({
pid: doc.data().pid,
title: doc.data().title,
});
});
} catch (error) {
console.log('Error getting documents: ', error);
}
return {
props: {
videos,
},
};
};