title: "Could not establish connection. Receiving end does not exist" error trying to connect from React
body: <p>Chrome extension launches the app in a separate window from the domain "<a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a>" . The domain uses the  app React.</p>
  
  <p>My React App:</p>
  
  <p><strong>React:</strong></p>
  
  <pre><code>componentDidMount() {
    let connectApp = chrome.runtime.connect(
      "ID My Chrome Extension",
        {
          name: "test",
        }
      );
  
      connectApp.onMessage.addListener((msg, sender, sendResponse) =&gt; {
        console.log(msg);
      });
  
      connectApp.onDisconnect.addListener((obj) =&gt; {
        console.log("disconnected port", obj);
      });
  }
  </code></pre>
  
  <p>Chrome Extantion:</p>
  
  <p><strong>background.js</strong></p>
  
  <pre><code>
  function sendInfoProspectWithDom(data) {
    chrome.runtime.sendMessage({
        text: "create-new-propsect"
    });
  }
  
  chrome.runtime.onConnect.addListener(function (obj) {
    console.log("onConnect");
  });
  </code></pre>
  
  <p><strong>manifest.json</strong></p>
  
  <pre><code>{
    "manifest_version": 2,
    "name": "test",
    "version": "1.1.0",
    "description": "test Description",
    "browser_action": {},
    "background": {
      "scripts": ["background.js"],
      "persistent": true
    },
    "content_scripts": [
      {
        "matches": ["*://mail.google.com/*"],
        "js": ["content.js"]
      }
    ],
    "externally_connectable": {
      "ids": ["*"],
      "matches": [
        "https://localhost:3000/*",
        "http://localhost:3000/*"
      ],
      "accepts_tls_channel_id": false
    },
    "icons": {
      "16": "icon16.png",
      "48": "icon48.png",
      "128": "icon128.png"
    },
    "permissions": [
      "tabs",
      "activeTab",
      "https://*/*",
      "http://*/*"
    ]
  }
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/ck8AJ.png" alt="enter image description here"></p>
  
  <p>|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</p>