如何解决Firebase模拟器无法以无意义的错误启动
我们已经使用模拟器已有一段时间了。突然,他们停止在两个开发人员(但不是所有开发人员)的机器上工作。它们尝试调用firebase emulators:start
,然后被处理以下错误消息:Error: An unexpected error has occurred.
我们真的不知道为什么会这样。我们甚至尝试重做firebase init和模拟器init。到目前为止,我们没有尝试过任何帮助。这是控制台输出,以获取更多详细信息:
➜ firebase git:(dev-vab) ✗ firebase emulators:start
i emulators: Starting emulators: functions,firestore,database,hosting,pubsub
⚠ functions: The following emulators are not running,calls to these services from the Functions emulator will affect production: auth
⚠ Your requested "node" version "10" doesn't match your global version "14"
i firestore: Firestore Emulator logging to firestore-debug.log
i database: Database Emulator logging to database-debug.log
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://0.0.0.0:5000
i pubsub: Pub/Sub Emulator logging to pubsub-debug.log
i ui: Emulator UI logging to ui-debug.log
i functions: Watching "/Users/isaacmartin/git_repos/firebase/functions" for Cloud Functions...
✔ functions[updateUser]: firestore function initialized.
✔ functions[handleEventInviteeCreation]: http function initialized (http://0.0.0.0:5001/likemindedly-stage/us-central1/handleEventInviteeCreation).
i emulators: Shutting down emulators.
i ui: Stopping Emulator UI
⚠ Emulator UI has exited upon receiving signal: SIGINT
i functions: Stopping Functions Emulator
i hosting: Stopping Hosting Emulator
i database: Stopping Database Emulator
i firestore: Stopping Firestore Emulator
i pubsub: Stopping Pub/Sub Emulator
i hub: Stopping emulator hub
i logging: Stopping Logging Emulator
Error: An unexpected error has occurred.
Having trouble? Try again or contact support with contents of firebase-debug.log
现在,您会注意到我们确实检查了调试日志,并发现了可能与之相关的以下内容:
[debug] [2020-10-22T22:06:39.394Z] 15:06:39.394 [FirebaseWorkerPool-1-2] WARN com.firebase.core.namespace.NamespaceActorSystem - Request for ns: likemindedly-stage has incorrect domain. Current domain: 0.0.0.0,expected domain: firebaseio-staging.com
{"Metadata":{"emulator":{"name":"database"},"message":"15:06:39.394 [FirebaseWorkerPool-1-2] WARN com.firebase.core.namespace.NamespaceActorSystem - Request for ns: likemindedly-stage has incorrect domain. Current domain: 0.0.0.0,expected domain: firebaseio-staging.com\n"}}
[debug] [2020-10-22T22:06:39.448Z] <<< HTTP RESPONSE 404 {"content-length":"231","content-type":"application/json; charset=utf-8","access-control-allow-origin":"*","cache-control":"no-cache"}
[debug] [2020-10-22T22:06:39.448Z] <<< HTTP RESPONSE BODY {
"correctUrl" : "https://likemindedly-stage.firebaseio-staging.com","error" : "Namespace likemindedly-stage lives in a different region. Please change your database URL to https://likemindedly-stage.firebaseio-staging.com"
}
似乎在抱怨我们在配置中指向本地仿真器,但不清楚为什么会出现问题?
解决方法
几个小时前,我也遇到了这个问题。当我从firebase.json中删除主机时,它允许我正常启动仿真器,但是我还没有弄清楚到底是什么引起了错误,或者如何在json文件之外正确设置主机。
,解决此问题的另一种方法是将新的firebase身份验证模拟器添加到您的模拟器套件中。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。