title: I tryed to fix everything, but still getting : TypeError: Cannot set properties of null (setting 'innerHTML')
body: <p>I am getting following error in my code :</p>
  <p><a href="https://i.stack.imgur.com/R42ni.png" rel="nofollow noreferrer">Image (i dont have REP 10 so i can post it like link only)</a></p>
  <p>Everything worked when i opend it in my PC, but hosting is maing some errors</p>
  <p>I tried all fixes that i found, but nothing happend. Everything wprked well untill i reuploaded code to webpage and reseted hosting. Anyone know why i am getting this error, or ho to improve code to make it working?</p>
  <pre><code>TypeError: Cannot set properties of null (setting 'innerHTML')             subscribe.js:159 
      at Object.next (index.js:13)
      at subscribe.js:48
      at subscribe.js:152
  </code></pre>
  <p><strong>HTML:</strong></p>
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;WocaBoo - Download&lt;/title&gt;
          &lt;link rel=&quot;shortcut icon&quot; href=&quot;https://jzh56g.zombeek.cz/elements/images/uploads/40539/wocaboo1.png&quot; type=&quot;image/x-icon&quot;&gt;
          &lt;link href=&quot;https://fonts.googleapis.com/css?family=Nunito:400,600,700&quot; rel=&quot;stylesheet&quot;&gt;
          &lt;script src=&quot;https://www.google.com/recaptcha/api.js&quot; async defer&gt;&lt;/script&gt;
          &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; /&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      
      &lt;div id=&quot;login_div&quot; class=&quot;main-div&quot;&gt;
          &lt;h3&gt;Login to download&lt;/h3&gt;
          &lt;input type=&quot;email&quot; placeholder=&quot;Email...&quot; id=&quot;email_field&quot; /&gt;
          &lt;input type=&quot;password&quot; placeholder=&quot;Password...&quot; id=&quot;password_field&quot; /&gt;
          &lt;div class=&quot;g-recaptcha&quot; data-sitekey=&quot;6Lcd0-gdAAAAAAuOarm420yReswr5IY0tUpnhX74&quot; data-callback=&quot;enableBtn&quot;&gt;&lt;/div&gt;
        
  
          &lt;button id=&quot;log&quot; disabled=discabled onclick=&quot;login()&quot;&gt;Sign In&lt;/button&gt;
          &lt;p&gt; &lt;/p&gt;
          &lt;button id=&quot;regis&quot; disabled=disabled onclick=&quot;register()&quot;&gt;Sign Up&lt;/button&gt;
          &lt;p&gt; &lt;/p&gt;
  
  
      &lt;div id=&quot;user_div&quot; class=&quot;loggedin-div&quot;&gt;
          &lt;h3&gt;Welcome User&lt;/h3&gt;
          &lt;button onclick=&quot;location.href = 'https://filetransfer.io/data-package/Q0dtm1T2/download'; logout();&quot;&gt;Download&lt;/button&gt;
          &lt;button onclick=&quot;logout()&quot;&gt;LogOut&lt;/button&gt;
      &lt;/div&gt;
  
  
  
      &lt;script src=&quot;https://www.gstatic.com/firebasejs/4.8.1/firebase.js&quot;&gt;&lt;/script&gt;
      &lt;script&gt;
          // Initialize Firebase
          var config = {
              apiKey: &quot;AIzaSyAuP2H1XCM98n_eo_qL0USEs7hGOCfp3RM&quot;,
              authDomain: &quot;wocaboo-c5116.firebaseapp.com&quot;,
              projectId: &quot;wocaboo-c5116&quot;,
              storageBucket: &quot;wocaboo-c5116.appspot.com&quot;,
              messagingSenderId: &quot;978655629649&quot;,
              appId: &quot;1:978655629649:web:f513370e6fca4ee2aa4370&quot;,
              measurementId: &quot;G-8K3L4XPQHN&quot;
          };
          firebase.initializeApp(config);
      &lt;/script&gt;
  
      &lt;/body&gt;
      &lt;script src=&quot;index.js&quot;&gt;&lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  <p><strong>JS</strong>:</p>
  <pre class="lang-js prettyprint-override"><code>firebase.auth().onAuthStateChanged(function(user) {
    if (user) {
      // User is signed in.
  
      document.getElementById(&quot;user_div&quot;).style.display = &quot;block&quot;;
      document.getElementById(&quot;login_div&quot;).style.display = &quot;none&quot;;
  
      var user = firebase.auth().currentUser;
  
    if(user != null){
  
      var email_id = user.email;
      document.getElementById(&quot;user_para&quot;).innerHTML = &quot;Welcome User : &quot; + email_id;
  
      }
  
    } else {
      // No user is signed in.
  
      document.getElementById(&quot;user_div&quot;).style.display = &quot;none&quot;;
      document.getElementById(&quot;login_div&quot;).style.display = &quot;block&quot;;
  
    }
  });
  
  function login(){
  
    var userEmail = document.getElementById(&quot;email_field&quot;).value;
    var userPass = document.getElementById(&quot;password_field&quot;).value;
  
    firebase.auth().signInWithEmailAndPassword(userEmail, userPass).catch(function(error) {
      // Handle Errors here.
      var errorCode = error.code;
      var errorMessage = error.message;
  
      window.alert(&quot;Error : &quot; + errorMessage);
  
      // ...
    });
  
  }
  
  function register(){
  
    var userEmail = document.getElementById(&quot;email_field&quot;).value;
    var userPass = document.getElementById(&quot;password_field&quot;).value;
  
    firebase.auth().createUserWithEmailAndPassword(userEmail, userPass).catch(function(error) {
      // Handle Errors here.
      var errorCode = error.code;
      var errorMessage = error.message;
  
      window.alert(&quot;Error : &quot; + errorMessage);
  
      // ...
    });
  
  function disableeBtn(){
     document.getElementById(&quot;log&quot;).disabled = true;
     document.getElementById(&quot;regis&quot;).disabled = true;
   }
  
  }
  
  function enableBtn(){
     document.getElementById(&quot;log&quot;).disabled = false;
     document.getElementById(&quot;regis&quot;).disabled = false;
   }
  
  function logout(){
    firebase.auth().signOut();
  }
  </code></pre>
  <p><strong>CSS</strong>:</p>
  <pre class="lang-css prettyprint-override"><code>body {
    background: #fff;
    padding: 0px;
    margin: 0px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
  }
  
  input, button {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
  }
  
  .main-div, .loggedin-div {
    width: 20%;
    margin: 0px auto;
    margin-top: 150px;
    padding: 20px;
    display: none;
  }
  
  .main-div input {
    display: block;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    padding: 15px;
    outline: none;
    width: 100%;
    margin-bottom: 20px;
    transition: 0.3s;
    -webkit-transition: 0.3s;
    -moz-transition: 0.3s;
  }
  
  .main-div input:focus {
    border: 1px solid #777;
  }
  
  .main-div button, .loggedin-div button {
    background: #971717;
    color: #fff;
    border: 1px solid #971717;
    border-radius: 5px;
    padding: 15px;
    display: block;
    width: 100%;
    transition: 0.3s;
    -webkit-transition: 0.3s;
    -moz-transition: 0.3s;
  }
  
  .main-div button:hover, .loggedin-div button:hover {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    cursor: pointer;
  }
  </code></pre>