title: Uncaught ReferenceError: io is not defined, when open it through Heroku
body: <p>When I open app through heroku it shows couple errors related with Socket.io. When I run it on localhost everything works just fine.</p>
  
  <pre><code>// server.js
  const app = require('./app');
  const server = require('http').createServer(app);
  const io = require('socket.io')(server);
  
  console.log(`Mode: ${process.env.NODE_ENV}`);
  const port = process.env.PORT || 3000;
  server.listen(port, () =&gt; {
    console.log(`Server running on port: ${port}`);
  });
  </code></pre>
  
  <pre><code>// index.html
  script(src='/socket.io/socket.io.js')
  script(src='/js/bundle.js')
  </code></pre>
  
  <pre><code>// script.js
  import io from 'socket.io-client';
  const socket = io();
  </code></pre>
  
  <pre><code>Failed to load resource: net::ERR_CONNECTION_REFUSED
  jQuery.Deferred exception: io is not defined ReferenceError: io is not defined
      at HTMLDocument.&lt;anonymous&gt; (https://infinite-meadow-83816.herokuapp.com/js/bundle.js:604:6379)
      at l (https://infinite-meadow-83816.herokuapp.com/js/bundle.js:535:29386)
      at c (https://infinite-meadow-83816.herokuapp.com/js/bundle.js:535:29688) undefined
  Uncaught ReferenceError: io is not defined
      at HTMLDocument.&lt;anonymous&gt; (bundle.js:604)
      at l (bundle.js:535)
      at c (bundle.js:535)
  DevTools failed to parse SourceMap: https://infinite-meadow-83816.herokuapp.com/bundle.js.map
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/I1t5x.png" rel="nofollow noreferrer">Image with errors</a></p>