Expo项目中@react-native-firebase/firestore相关错误排查求助
Expo + React Native Firebase 问题排查求助
遇到的错误
运行npx expo-doctor时触发两个核心错误:
- PluginError
Package "@react-native-firebase/firestore" does not contain a valid config plugin. Unexpected token 'typeof'
- Error [ERR_UNSUPPORTED_DIR_IMPORT]
目录导入错误,指向路径@react-native-firebase/app/lib/common/index.js
已尝试的无效操作
- 执行
expo start -c清除Expo缓存 - 在
android目录运行./gradlew clean清理构建,反而引发更多错误 - 将Node.js从v22.12.0降级到v18,出现新的兼容性错误
- 确认
@react-native-firebase/app、@react-native-firebase/auth、@react-native-firebase/firestore为最新版本且符合官方文档要求 - 更新并重新安装所有依赖,确保版本匹配
环境详情
- Expo SDK版本:52.0.18
- React Native版本:0.76.5
- Node.js版本:22.12.0
- 核心依赖:
@react-native-firebase/app、@react-native-firebase/auth、@react-native-firebase/firestore
已启用EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS和EXPO_DEBUG日志,但未定位到明确根因。项目处于初期阶段,不想重新搭建,想请教:
- 还有哪些可行的排查或解决方法?
- 问题是否与Metro打包器或Firebase依赖直接相关?
- 这些Firebase库与Expo SDK 52是否存在已知兼容性问题?
内容的提问来源于stack exchange,提问作者Minolga Fox
相关产品推荐
相关产品推荐

