gpt4 book ai didi

firebase - Flutter Web Firebase TypeError : dart.global.firebase.firestore is not a function

转载 作者:行者123 更新时间:2023-12-03 09:45:21 27 4
gpt4 key购买 nike

我正在尝试在Flutter网站项目中使用Firebase。
但是应用程序无法与此消息一起运行。

TypeError: dart.global.firebase.firestore is not a function
at Object.firestore$ [as firestore]
我的 index.html看起来像这样。
  <script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-analytics.js"></script>

<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "MY_API_KEY",
authDomain: "MY_AUTHDOMAIN",
databaseURL: "MY_URL",
projectId: "MY_ID",
storageBucket: "MY_BUCKET",
messagingSenderId: "MY_ID",
appId: "MY_APPID",
measurementId: "MY_ID"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
</script>
有人知道如何解决这个问题吗?
谢谢!!

最佳答案

index.html中添加此行即可解决问题。

  <script src="https://www.gstatic.com/firebasejs/7.17.1/firebase-firestore.js"></script>

关于firebase - Flutter Web Firebase TypeError : dart.global.firebase.firestore is not a function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63248596/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com