title: Electron ERR_CONNECTION_REFUSED to localhost:3000 Since Build
body: <p>I've been working on a small app with React/Electron, and so far things are working out. Building it is a bit complicated for me. Ever since I've built this application, I can no longer run npm run dev to develop this app locally (localhost:3000), I get this error:</p>
  <pre><code> electron: Failed to load URL: http://localhost:3000/ with error: ERR_CONNECTION_REFUSED
  </code></pre>
  <p>I've checked with electron is dev and we are still currently in development.</p>
  <p>My loadURL is fairly simple:</p>
  <pre><code>mainWindow.loadURL(isDev
          ? 'http://localhost:3000'
          : `file://${path.join(__dirname, '../build/index.html')}`);
  </code></pre>
  <p>These are my package.json scripts:</p>
  <pre><code>  &quot;scripts&quot;: {
      &quot;start&quot;: &quot;react-scripts start&quot;,
      &quot;build&quot;: &quot;react-scripts build&quot;,
      &quot;test&quot;: &quot;react-scripts test&quot;,
      &quot;eject&quot;: &quot;react-scripts eject&quot;,
      &quot;dev&quot;: &quot;wait-on tcp:3000 &amp;&amp; concurrently -k \&quot;npm:electron\&quot;&quot;,
      &quot;electron&quot;: &quot;electron .&quot;,
      &quot;electron:package:mac&quot;: &quot;yarn build &amp;&amp; electron-builder -m -c.extraMetadata.main=build/electron.js&quot;,
      &quot;electron:package:win&quot;: &quot;yarn build &amp;&amp; electron-builder -w -c.extraMetadata.main=build/electron.js&quot;,
      &quot;electron:package:linux&quot;: &quot;yarn build &amp;&amp; electron-builder -l -c.extraMetadata.main=build/electron.js&quot;
    },
  </code></pre>
  <p>I read a thread on stackoverflow that mentioned to switch loadURL to the index in build folder, which it will load there but it doesn't show the updates I'm working on until I actually build the app.</p>
  <p>I've also tried to kill-port 3000, and still getting the same issue.</p>
  <p>Any help would be appreciated.</p>
  <p>Thanks.</p>