title: Why gulp-livereload causes "Uncaught SyntaxError: Unexpected token <"?
body: <p>In my <a href="https://github.com/moroshko/github-explorer/blob/master/gulpfile.js" rel="nofollow"><code>gulpfile.js</code></a> I set up <a href="https://github.com/strongloop/express" rel="nofollow"><code>express</code></a> to always return <code>index.html</code>.</p>
  
  <pre><code>var server = express();
  server.use(livereload({ port: 35729 }));
  server.use(express.static('./app'));
  server.all('*', function(req, res) {
    res.sendFile('index.html', { root: './app' });
  });
  
  server.listen(8000);
  refresh.listen(35729);
  </code></pre>
  
  <p>All works fine the first time I navigate to <code>localhost:8000</code>. My Angular routes redirect to <code>http://localhost:8000/home</code>.</p>
  
  <p>But, if then I refresh <code>http://localhost:8000/home</code>, I see the following error in the console:</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token &lt;
  </code></pre>
  
  <p>Why is this happening?</p>
  
  <p><kbd><a href="https://github.com/moroshko/github-explorer" rel="nofollow">DEMO HERE</a></kbd></p>