title: Uncaught FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app)
body: <pre><code>&lt;form class="modal-content" id="bookingForm"&gt;
      &lt;div class="formContainer"&gt;
        &lt;h1&gt;Booking Form&lt;/h1&gt;
        &lt;p&gt;Please fill in this form to Book The Trip.&lt;/p&gt;
        &lt;hr&gt;
        &lt;label for="email"&gt;&lt;b&gt;Email&lt;/b&gt;&lt;/label&gt;
        &lt;input type="text" placeholder="Enter Email" name="email" required id="email"&gt;
  
  
        &lt;label&gt;&lt;b&gt;Package&lt;/b&gt;&lt;/label&gt;
  
        &lt;input type="text" id="packageFields" name="teste2"&gt;
  
        &lt;label for="psw"&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/label&gt;
        &lt;input type="text" placeholder="Enter Name" name="name" required id="name"&gt;
  
        &lt;label for="psw-repeat"&gt;&lt;b&gt;Phone No.&lt;/b&gt;&lt;/label&gt;
        &lt;input type="tel" placeholder="Enter Phone No." name="psw-repeat" required id="phone"&gt;
  
        &lt;label for="psw-repeat"&gt;&lt;b&gt;Date Of Journey&lt;/b&gt;&lt;/label&gt;
        &lt;input type="date" placeholder="Enter Phone No." name="psw-repeat" required id="date"&gt;
  
        &lt;p&gt;By creating an account you agree to our &lt;a href="#" style="color:dodgerblue"&gt;Terms &amp; Privacy&lt;/a&gt;.&lt;/p&gt;
  
        &lt;div class="clearfix"&gt;
          &lt;button type="submit" class="signupbtn"&gt;Confirm Booking&lt;/button&gt;
          &lt;button type="button" onclick="document.getElementById('bookingForm').style.display='none'" class="cancelbtn"&gt;Cancel&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/form&gt;
  &lt;/div&gt;
      &lt;/section&gt;
      &lt;!-- animation --&gt;
      &lt;script src="https://unpkg.com/aos@2.3.1/dist/aos.js"&gt;&lt;/script&gt;
      &lt;script&gt;
      AOS.init();
  
      var modal = document.getElementById('bookingForm');
  // Script To Copy Package Name To The Form Automatically
  // When the user clicks anywhere outside of the modal, close it
  window.onclick = function(event) {
    if (event.target == modal) {
      modal.style.display = "none";
    }
  }
  
  function setPackage(packageName) {
    document.querySelector('#packageFields').value = packageName;
  }
      &lt;/script&gt;
      &lt;script src="https://www.gstatic.com/firebasejs/7.14.5/firebase-app.js"&gt;&lt;/script&gt;
  
      &lt;!-- Insert these scripts at the bottom of the HTML, but before you use any Firebase services --&gt;
  
   &lt;!-- Firebase App (the core Firebase SDK) is always required and must be listed first --&gt;
   &lt;script src="/__/firebase/7.14.5/firebase-app.js"&gt;&lt;/script&gt;
  
   &lt;!-- If you enabled Analytics in your project, add the Firebase SDK for Analytics --&gt;
   &lt;script src="/__/firebase/7.14.5/firebase-analytics.js"&gt;&lt;/script&gt;
  
   &lt;!-- Add Firebase products that you want to use --&gt;
   &lt;script src="/__/firebase/7.14.5/firebase-auth.js"&gt;&lt;/script&gt;
   &lt;script src="/__/firebase/7.14.5/firebase-firestore.js"&gt;&lt;/script&gt;
   &lt;script src="/__/firebase/init.js"&gt;&lt;/script&gt;
   &lt;script src="bookingSubmit.js"&gt;    &lt;/script&gt;
  </code></pre>
  
  <p>This Is The Html And The JavaSript Is Given Below:</p>
  
  <pre><code>var firebaseConfig = {
     apiKey: "AIzaSyDT80mEpNS4CpdByl2ugrSTGzgQpkbzzeI",
     authDomain: "himwhitecab.firebaseapp.com",
     databaseURL: "https://himwhitecab.firebaseio.com",
     projectId: "himwhitecab",
     storageBucket: "himwhitecab.appspot.com",
     messagingSenderId: "505950138314",
     appId: "1:505950138314:web:c37c1b2c593f30e911e933",
     measurementId: "G-ECR97G3YY0"
   };
  
  //reference messages collection
  
  
  firebase.initializeApp(firebaseConfig);
  var firestore =  firebase.firestore();
  
  const submitBtn = document.querySelector("#signupbtn");
  
  
  let email = document.querySelector('#email');
  let packageFields = document.querySelector('#packageFields');
  let name = document.querySelector('#name');
  let phone = document.querySelector('#phone');
  let date = document.querySelector('#date');
  
  const db = firestore.collection(BookingData);
  
  submitBtn.addEventListner('click', function(){
    let userEmailInput = email.value;
    let userPackageInput = packageFields.value;
    let userNameInput = name.value;
    let userPhoneInput = phone.value;
    let userDateInput = date.value;
  
    db.doc()
    .set({
      email:userEmailInput,
      package:userPackageInput,
      name:userNameInput,
      phone:userPhoneInput,
      date:userDateInput
    })
    .then(function(){
      console.log("Data Saved");
    })
    .catch(function(error){
      console.log(error);
    });
  });
  </code></pre>
  
  <p>I am using this to store the data of my contact forms in my Firebase.</p>
  
  <p>But It Gives The Error:</p>
  
  <blockquote>
    <p>Uncaught FirebaseError: Firebase: Firebase App named '[DEFAULT]' already exists (app/duplicate-app).
        at initializeApp (<a href="http://localhost:5000/__/firebase/7.14.5/firebase-app.js:1:15287" rel="nofollow noreferrer">http://localhost:5000/<strong>/firebase/7.14.5/firebase-app.js:1:15287</a>)
        at Object.ee.initializeApp (<a href="http://localhost:5000/__/firebase/7.14.5/firebase-app.js:1:19566" rel="nofollow noreferrer">http://localhost:5000/</strong>/firebase/7.14.5/firebase-app.js:1:19566</a>)
        at <a href="http://localhost:5000/bookingSubmit.js:15:10" rel="nofollow noreferrer">http://localhost:5000/bookingSubmit.js:15:10</a></p>
  </blockquote>
  
  <p>How To Solve This Problem....??</p>
  
  <p>Thanks For Help In Advance.</p>
  
  <p>PS: I am Also using one more html file called index.html</p>