Postingan lainnya
Kelas Premium!
Belajar Javascript untuk website
Gunakan kupon "mulaijs" untuk diskon 75 ribu!
Error firebase saat menjalankan fungsi database
Muncul error saat menjalankan fungsi -> var messageRef = firebase.database();
Padahal sudah inisiasi firebase dan configurasi lewat javascript. Error di console sbb -> Uncaught TypeError: firebase.database is not a function
Berikut source code nya (ditaruh di akhir body):
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-firestore.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
var firebaseConfig = {
apiKey: "api-key",
authDomain: "project-id.firebaseapp.com",
databaseURL: "https://project-id.firebaseio.com",
projectId: "project-id",
storageBucket: "project-id.appspot.com",
messagingSenderId: "sender-id",
appID: "app-id",
};
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
// instance referance
var db = firebase.database();
</script>
0
1 Jawaban:
firebase confignya kenama dua kali?
<pre> var firebaseConfig = { var firebaseConfig = { </pre>
0