我的firebase仅在我在visual studio中运行页面时才有效

时间:2018-04-07 11:54:16

标签: javascript html firebase

我正在建立一个带有firebase(用户,数据库)的网站,它几天前工作完美,但是现在当我从文件浏览器打开主页时,firebase没有用,但是当我从visual studio打开它时它就像一种魔力。我还有两个奇怪的错误:

On {code: "auth/network-request-failed", message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred."}
code
:
"auth/network-request-failed"
message
:
"A network error (such as timeout, interrupted connection or unreachable host) has occurred."
__proto__
:
Error
main.html:1 Failed to load https://securetoken.googleapis.com/v1/token?key=AIzaSyBqJx6CHQdHf2VibQTVPGb1NJ7oiCumK3c: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'null' that is not equal to the supplied origin. Origin 'null' is therefore not allowed access.

我不知道问题是什么,所以我会感谢任何帮助或尝试提供帮助

1 个答案:

答案 0 :(得分:0)

如果您没有安装firebase CLI。然后安装然后在你的项目的根目录下作为firebase服务运行。您的项目将在5000端口提供,因此http://localhost:5000/将为您的项目提供firebase的全部功能。完整信息:https://firebase.google.com/docs/cli