title: React/Node Uncaught SyntaxError: Unexpected token <
body: <p>I've tried everything but I'm a bit lost on where I should look into this issue.</p>
  
  <p>What happens is that once you build the react app and deploy it (using node/express), it works perfectly. However, if you build again and take the build folder to the node server, it gives me that syntax error. This only happens if your browser already opened the app once.</p>
  
  <p>I've done research and people were saying that the browser is trying to load the older static files and that's why this occurs. None of their solutions worked though from what I've tried.</p>
  
  <p>I would very much appreciate anyone's help with this issue.</p>
  
  <p>Cheers</p>
  
  <p><a href="https://i.stack.imgur.com/jHOfe.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jHOfe.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/OCu9X.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OCu9X.png" alt="enter image description here"></a></p>
  
  <p><strong>Update</strong></p>
  
  <p>As Davin suggested. I looked into the chrome devtools and here is what I got back in the response</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en" id="html"&gt;
  
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"&gt;
      &lt;meta name="theme-color" content="#000000"&gt;
      &lt;script src="/js/modernizr.js"&gt;&lt;/script&gt;
      &lt;link rel="manifest" href="/manifest.json"&gt;
      &lt;link rel="shortcut icon" href="/favicon.ico"&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
          integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
          crossorigin="anonymous"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="/css/mega-nav.css"&gt;
      &lt;link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"&gt;
      &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.4.1/css/swiper.min.css"&gt;
      &lt;title&gt;Q Parts&lt;/title&gt;
      &lt;link href="/static/css/style.css" rel="stylesheet"&gt;
      &lt;link href="/static/css/main.css" rel="stylesheet"&gt;
      &lt;link href="/static/css/main-ar.css" rel="stylesheet"&gt;
  &lt;/head&gt;
  
  &lt;body&gt;&lt;noscript&gt;You need to enable JavaScript to run this app.&lt;/noscript&gt;
      &lt;div id="root"&gt;&lt;/div&gt;
      &lt;script src="/js/jquery-3.3.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://code.jquery.com/jquery-migrate-3.0.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="/js/jquery.mobile.custom.min.js"&gt;&lt;/script&gt;
      &lt;script src="/js/popper.min.js"&gt;&lt;/script&gt;
      &lt;script src="/js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;script src="/js/main.js"&gt;&lt;/script&gt;
      &lt;script&gt;$(document).ready(function () { $(".has-children").hover(function () { $(".overlay-lg").addClass("is-visible") }, function () { $(".overlay-lg").removeClass("is-visible") }), $(".cd-primary-nav li").click(function () { $(".cd-primary-nav").animate({ scrollTop: $(".nav-is-visible").offset().top }, "200") }) })&lt;/script&gt;
      &lt;script type="text/javascript" src="/static/js/main.957b5c6e.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/VDN5n.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VDN5n.png" alt="enter image description here"></a></p>