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>

avatar thariqaudah
@thariqaudah

1 Kontribusi 0 Poin

Diperbarui 5 tahun yang lalu

1 Jawaban:

firebase confignya kenama dua kali?

<pre> var firebaseConfig = { var firebaseConfig = { </pre>

avatar hilmanski
@hilmanski

2689 Kontribusi 2137 Poin

Dipost 5 tahun yang lalu

Login untuk ikut Jawaban