Next.js 13 Turbo Pack下Firestore连接异常:无法连接后端问题
问题排查求助
已确认以下内容均无问题:
- 网络连接稳定
- Firebase配置反复校验无误
- 已安装对应版本的
firebase包 - 项目中Firebase与Firestore初始化流程正确
原本package.json中的dev脚本配置为:
"dev": "next dev"
此时项目无Firebase相关错误,整体运行正常。
但将dev脚本修改为:
"dev": "next dev --turbo"
后,在Turbo Pack模式下出现异常:客户端可正常获取Firestore数据(已验证),但服务端无法获取数据,异步查询返回空数组且无报错,控制台输出如下提示:
@firebase/firestore: Firestore (9.19.1): Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: FirebaseError: [code=unavailable]: The operation could not be completed
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
请问还有哪些排查方向或解决步骤?感谢帮助!
好消息:
将项目所有依赖更新至Next.js 13.4版本后,问题完全解决,一切运行正常。
内容的提问来源于stack exchange,提问作者Tom Fan
相关产品推荐
相关产品推荐

