I receive: firebase.database is not a function error when trying to connect my form to the database

后端 未结 1 1184
醉酒成梦
醉酒成梦 2021-01-28 07:03

I\'m trying to connect my contact form to a firebase database and i keep getting the firebase.database is not a function error continuously. I\'m also using parcel-bundler for

相关标签:
1条回答
  • 2021-01-28 07:36

    You're currently only including this for Firebase:

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

    This only contains the definition of FirebaseApp, and doesn't include Firebase Authentication (firebase.auth()) or Firebase Realtime Database (firebase.database()). To include those, be sure to include the correct scripts for that too:

    <script src="https://www.gstatic.com/firebasejs/6.0.2/firebase-auth.js"></script>
    <script src="https://www.gstatic.com/firebasejs/6.0.2/firebase-database.js"></script>
    
    0 讨论(0)
提交回复
热议问题