gpt4 book ai didi

javascript - 类型错误 : Cannot read property 'FieldValue' of undefined

转载 作者:行者123 更新时间:2023-12-01 23:52:00 25 4
gpt4 key购买 nike

  19 | event.preventDefault();
20 | db.collection('todos').add({
21 | todo:input,
22 | timestamp: firebase.firestore.FieldValue.serverTimestamp()
23 | });
24 |
25 | setInput("");

每当我尝试运行这段代码时,它都会显示类型错误。这样我就无法将数据推送到 firebase

最佳答案

确保从“firebase”导入 firebase 而不是从“./firebase”导入 firebase。

和你有同样的问题,通过这样做解决了它。

关于javascript - 类型错误 : Cannot read property 'FieldValue' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63352015/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com