title: Facing Error while developing a chrome extension
body: <p>I am pretty new to the concept of developing a chrome extension , and I am facing this issue since last 1-2 days and I am not able to solve it.</p>
  <p>I have tried every possible method mentioned over the Internet but I am not able to get rid of this issue.</p>
  <p>Here , is the piece of code where I am incurring this issue :</p>
  <pre><code>chrome.runtime.onMessage.addListener(async (msg, sender, response) =&gt; {
    //Listening for different Kind of message Events to and from the Extenstion to the Database :
    if (msg.command == &quot;fetchNotes&quot;) {
      //Processing the Request then after listening to the request
      firebase
        .database()
        .ref(&quot;/notes&quot;)
        .once(&quot;value&quot;)
        .then(function (snapshot) {
          response({
            type: &quot;result&quot;,
            status: &quot;success&quot;,
            data: snapshot.val(),
            request: msg,
          });
        });
  
      
    }
    return true ;
  });
  
  The error which , I am getting is this :
  </code></pre>
  <p>&quot;Unchecked runtime.lastError: The message port closed before a response was received.&quot;</p>