import app from './server';
import http from 'http';

const server = http.createServer(app);

let currentApp = app;

server.listen(process.env.PORT || 3000, error => {
  if (error) {
    console.log(error);
  }

  console.log('🚀 started');
});

if (module.hot) {
  console.log('✅  Server-side HMR Enabled!');

  const noErrors = () => {
    try {
      require('./server').default;
    } catch (error) {
      console.error(error);
      return false;
    }
    return true;
  };

  module.hot.accept('./server', () => {
    if (noErrors()) {
      console.log('🔁  HMR Reloading `./server`...');
      server.removeListener('request', currentApp);
      const newApp = require('./server').default;
      server.on('request', newApp);
      currentApp = newApp;
    }
  });
}

@@ -4,18 +4,19 @@
 ort 
-ap
+htt
 p from '
 ./se
@@ -15,42 +15,53 @@
 om '
-./server';%0Aimport http from 'http'
+http';%0A%0Alet app = require('./server').default
 ;%0A%0Ac
@@ -367,32 +367,35 @@
 equire('./server
+.js
 ').default;%0A    
@@ -666,18 +666,9 @@
     
-const newA
+a
 pp =
@@ -724,20 +724,17 @@
 quest', 
-newA
+a
 pp);%0A   
@@ -753,12 +753,9 @@
 p = 
-newA
+a
 pp;%0A

Change import to require