title: React.js + Node.js - Error when responding from server. "UnhandledPromiseRejectionWarning: Error: Request failed with status code 304"
body: <p>As the title suggest, I get a weird error when responding with data from my server.</p>
  <p>In homepage.js (which I want to load after loggin in) I have this request to the server to get the posts and then set the posts to the response.</p>
  <pre class="lang-js prettyprint-override"><code>useEffect(() =&gt; {
  //userService.getDashboard() === Axios.get('http://localhost:3001/homepage')
      userService.getDashboard().then((response) =&gt; {
          setListOfPosts(response)
      });
  }, []);
  </code></pre>
  <p>This request first goes to the homepage.js, which further sends a request to getPosts, like so:</p>
  <pre class="lang-js prettyprint-override"><code>    const headers = req.headers;
      const getPosts = Axios.get('http://localhost:3001/getPosts', {headers: headers});
  
      getPosts.catch((response) =&gt; {
          //NEVER GET ANY RESPONSE???
          console.log('Error in homepage.js')
          //res.send(response);
      });
  
      getPosts.then((response) =&gt; {
          //NEVER GET ANY RESPONSE???
          res.send(response.data);
      });
  </code></pre>
  <p>And lastly in the chain I have the getPosts router which does:</p>
  <pre class="lang-js prettyprint-override"><code>router.get('/', authenticateToken, async (req, res) =&gt; {
      await db.query('SELECT * FROM posts', 
      (err, result) =&gt; {
          if (err) {
              console.log('HELLO FROM ERROR')
              res.send({errorMessage: err});
          } else {
              console.log(result)
              res.send(result);
          }
      });
  }); 
  </code></pre>
  <p>So I can confirm that after every request to homepage I get all the way to getPosts() and the database query always works fine and goes into the result where &quot;console.log(result)&quot; lies and I can confirm that the result is indeed all the posts. The weird stuff happens when I'm sending back the data. So from getPosts() I'm obviously doing a res.send(result) which sends the data back to homepage.js. But this is when I get the error &quot;UnhandledPromiseRejectionWarning: Error: Request failed with status code 304&quot;</p>
  <p>Any idea why?</p>