You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 01:07:08