reactjs - 如何修复 React+Cloud Firestore 中的“未处理的拒绝(错误):不支持”错误
问题描述
我正在尝试使用以下查询查询 Cloud Firestore 数据库:
db.collection("shops").where("email", "==", user.email).get()
.then(...)
.catch(...)
我在“catch”块中编写了代码以处理承诺拒绝,但通过调用“.get()”出现以下错误
Unhandled Rejection (Error): not supported
我在网上查了这个错误,似乎没有人问这种错误。有人知道是什么原因造成的吗?我已经根据官方文档完成了我所有的 firebase/firestore 查询。谢谢!
解决方案
您使用的是哪个 Firebase SDK?我在使用 Firebase-Admin 的 Node 应用程序上遇到了同样的错误,但是因为我使用 domino 创建一个 Window 对象,所以它会失败,因为它通过检查 global.window 来检查它是否在 Node 上运行。
推荐阅读
- excel - 通过比较将两列分组以减少行数 | 代码优化
- python - 在 Jupyter Notebook 中进行时,pandas.read_gbq() 在哪里“保存”查询?
- ios - 在不创建实例的情况下获取 UITabbar 的默认高度?
- python - Networkx:如何选择具有给定键值的所有边?
- python - Python:具有与基类相同的 __init__ 参数集的子类,加上额外的参数,而不使用 super()
- azure-sql-database - 架构 blob 未上传到暂存 blob
- bison - 野牛语法执行顺序
- types - 中缀运算符“+”没有可行的条目。如何理解数据类型要求/转换?
- wordpress - Plesk 返回 401 POST 到 wp-cron.php?doing_wp_cron,WooCommerce Webhooks 待定
- html - HTML 对未知颜色有什么作用?