0

this is a very basic question. I'm trying to get firebase to work with my javascript and I'm using a very basic script from a tutorial. I'm a beginner and I don't know if there are other ways to insert debugging statements, but my console.log() calls are not working. I also tried putting in a debugger call to no effect. I read a lot of the other questions about console.log not working but they were much more complicated than my situation (and, honestly, I couldn't make heads or tails of them). Basically, I get nothing, as though it's not reading that code at all. Can anyone help me debug this? Code looks as follows. Thank you for any help!

<script type="module" src="https://www.gstatic.com/firebasejs/11.6.1/firebase-app.js">
      const firebase = require("firebase/app");

      // Your web app's Firebase configuration
      // For Firebase JS SDK v7.20.0 and later, measurementId is optional
      const firebaseConfig = {
            apiKey: "AIzaSyBADV4O4Oyc2xaHcLHwZficznzpoU13Gm0",
            authDomain: "my-first-project-1de2f.firebaseapp.com",
            projectId: "my-first-project-1de2f",
            storageBucket: "my-first-project-1de2f.firebasestorage.app",
            messagingSenderId: "741734388415",
            appId: "1:741734388415:web:6e4075ceaad15606816c0a",
            measurementId: "G-H0X2KKG0XP"
      };

      // Initialize Firebase
      const app = initializeApp(firebaseConfig);
      const analytics = getAnalytics(app);
      debugger:
      console.log('txt');
      
      // getting the text value from the database
      var bigOne = document.getElementById('bigOne');
      console.log(bigOne);
      var dbRef = firebase.database().ref().child('Text');
      console.log(dbRef);
      dbRef.on('value', snap => bigOne.innerText = snap.val());

      }
</script>

P.S. I know it was reading the code because when I've made errors in the code, I got errors in the console.

2
  • 1
    Didn't we go over this last time? You don't seem to be following the guide very well for importing Firebase via CDN Commented May 9 at 2:45
  • If you're following a different tutorial, please link it Commented May 9 at 2:47

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.