【发布时间】:2020-01-31 14:44:28
【问题描述】:
我卡在Firebase web codelab page 8,收到错误:
FirebaseError:安装:缺少应用配置值:“appId”...
我认为我已按照说明进行操作。 http://localhost:5000/__/firebase/init.js 不包含这样的字段:
if (typeof firebase === 'undefined') throw new Error('hosting/init-error: Firebase SDK not detected. You must include it before /__/firebase/init.js');
var firebaseConfig = {
"projectId": "friendlychat-310120",
"databaseURL": "https://friendlychat-310120.firebaseio.com",
"storageBucket": "friendlychat-310120.appspot.com",
"locationId": "europe-west3",
"apiKey": "AIza...vOXg",
"authDomain": "friendlychat-310120.firebaseapp.com",
"messagingSenderId": "480343738796"
};
if (firebaseConfig) {
firebase.initializeApp(firebaseConfig);
}
这不仅仅是错误。阅读消息不起作用。
【问题讨论】:
-
如果 codelab 有问题,请在 GitHub 上发布问题以便修复。 github.com/firebase/friendlychat-web
-
好点。但没问题 - 我只是快速浏览了这里的说明codelabs.developers.google.com/codelabs/firebase-web/#2。它明确指出:“使用昵称友好聊天注册应用程序,然后选中还为此应用程序设置 Firebase 托管旁边的框。点击注册应用。”
标签: javascript firebase firebase-cloud-messaging