title: Implementing React Frontend with Flask Backend, Flask Backend produces a 404 Not Found Error
body: <p>I am posting this in desperation that potentially someone may be able to identify the real issue. I am working on a group project and this GitHub repository works for the rest of them. So I truly do not believe this is a package.json issue or anything that comes from the repository itself. It should be a dependency or something with my system specifically that is causing this issue.</p>
  <p><strong>If you have any ideas of what may be causing this issue, I would be really appreciative. My teammates have used this same strategy and functioned fine so I honestly am not sure what dependencies could possibly be causing this problem.</strong></p>
  <p>Environment: Windows 11, alternating between Anaconda Prompt and Windows Powershell, Node.js (16.13.0), Flask (2.0.2), Python (3.10.0). Each team member all has the same versions of these libraries and I've checked multiple times to ensure everything is the same version.</p>
  <p>Requirements List:
  click==8.0.3, colorama==0.4.4, Flask==2.0.2, Flask-Cors==3.0.10, itsdangerous==2.0.1, Jinja2==3.0.2, MarkupSafe==2.0.1, numpy==1.21.2, pandas==1.3.3, python-dateutil==2.8.2, python-dotenv==0.19.1, pytz==2021.3, six==1.16.0, Werkzeug==2.0.2</p>
  <p>Step Taken/Issue:</p>
  <ol>
  <li>Clone GitHub repository onto Visual Studio Code</li>
  <li>Open Windows Command Prompt and cd to this new directory in Visual Studio Workspace. Cd into the front-end subdirectory which contains the package.json file.</li>
  <li>Run &quot;npm install yarn&quot; and then &quot;npm install&quot;</li>
  <li>Run &quot;yarn start&quot; which opens the react app</li>
  <li>Run &quot;yarn start-backend&quot; in a <strong>separate terminal concurrently</strong> which returns a 404 File Not Found Error with the following error messages when I expect a functional page that my teammates are working with.</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/NG0Ek.png" rel="nofollow noreferrer"><strong>ERROR MESSAGE for yarn start-backend</strong></a></p>
  <p>What I have tried:</p>
  <ul>
  <li>Github repository is up to date. I have tried nuking the repository and recloning separate times.</li>
  <li>Uninstalling and reinstalling Flask</li>
  <li>Deleting the generated node-modules folder which includes all the dependencies from running &quot;yarn build&quot;. Run yarn build again which regenerates the node-modules folder.</li>
  <li>Uninstall Node.js and reinstall Node.js</li>
  </ul>
  <p>package.json</p>
  <pre><code>  {
    &quot;name&quot;: &quot;front-end&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@emotion/react&quot;: &quot;^11.4.1&quot;,
      &quot;@emotion/styled&quot;: &quot;^11.3.0&quot;,
      &quot;@material-ui/core&quot;: &quot;^4.12.3&quot;,
      &quot;@mui/material&quot;: &quot;^5.0.3&quot;,
      &quot;@mui/styled-engine&quot;: &quot;^5.0.1&quot;,
      &quot;@mui/styles&quot;: &quot;^5.0.1&quot;,
      &quot;@testing-library/jest-dom&quot;: &quot;^5.11.4&quot;,
      &quot;@testing-library/react&quot;: &quot;^11.1.0&quot;,
      &quot;@testing-library/user-event&quot;: &quot;^12.1.10&quot;,
      &quot;apexcharts&quot;: &quot;^3.29.0&quot;,
      &quot;react&quot;: &quot;^17.0.2&quot;,
      &quot;react-apexcharts&quot;: &quot;^1.3.9&quot;,
      &quot;react-dom&quot;: &quot;^17.0.2&quot;,
      &quot;react-scripts&quot;: &quot;^4.0.3&quot;,
      &quot;web-vitals&quot;: &quot;^1.0.1&quot;,
      &quot;yarn&quot;: &quot;^1.22.17&quot;
    },
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;react-scripts start&quot;,
      &quot;build&quot;: &quot;react-scripts build&quot;,
      &quot;start-backend&quot;: &quot;cd ../back-end &amp;&amp; python -m flask run&quot;,
      &quot;test&quot;: &quot;react-scripts test&quot;,
      &quot;eject&quot;: &quot;react-scripts eject&quot;
    },
    &quot;eslintConfig&quot;: {
      &quot;extends&quot;: [
        &quot;react-app&quot;,
        &quot;react-app/jest&quot;
      ]
    },
    &quot;browserslist&quot;: {
      &quot;production&quot;: [
        &quot;&gt;0.2%&quot;,
        &quot;not dead&quot;,
        &quot;not op_mini all&quot;
      ],
      &quot;development&quot;: [
        &quot;last 1 chrome version&quot;,
        &quot;last 1 firefox version&quot;,
        &quot;last 1 safari version&quot;
      ]
    },
    &quot;proxy&quot;: &quot;http://localhost:5000&quot;
  }
  </code></pre>
  <p>Error Message when running &quot;yarn start-backend&quot;</p>
  <pre><code>C:\Users\MKyle\VSWorkspace\Covid-Data-Dashboard\front-end&gt;yarn start-backend
      yarn run v1.22.17
  $ cd ../back-end &amp;&amp; python -m flask run
   * Environment: production
     WARNING: This is a development server. Do not use it in a production deployment.
     Use a production WSGI server instead.
   * Debug mode: off
   * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  127.0.0.1 - - [24/Nov/2021 17:25:22] &quot;GET /isolation-bed-occupants HTTP/1.1&quot; 200 -
  [2021-11-24 17:25:22,443] ERROR in app: Exception on /school-year-cases [GET]
  Traceback (most recent call last):
    File &quot;C:\Python310\lib\site-packages\flask\app.py&quot;, line 2073, in wsgi_app
      response = self.full_dispatch_request()
    File &quot;C:\Python310\lib\site-packages\flask\app.py&quot;, line 1518, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File &quot;C:\Python310\lib\site-packages\flask\app.py&quot;, line 1516, in full_dispatch_request
      rv = self.dispatch_request()
    File &quot;C:\Python310\lib\site-packages\flask\app.py&quot;, line 1502, in dispatch_request
      return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
    File &quot;C:\Users\MKyle\VSWorkspace\Covid-Data-Dashboard\back-end\app.py&quot;, line 27, in get_total_school_year_cases
      return bsu_parse_cases_since_school_start()
    File &quot;C:\Users\MKyle\VSWorkspace\Covid-Data-Dashboard\back-end\bsu_filter.py&quot;, line 62, in bsu_parse_cases_since_school_start
      total_cases = int(bsumain['Total_Cases'].iloc[0])
  ValueError: cannot convert float NaN to integer
  127.0.0.1 - - [24/Nov/2021 17:25:22] &quot;GET /school-year-cases HTTP/1.1&quot; 500 -
  [2021-11-24 17:25:23,865] ERROR in app: Exception on /bsuweekdata [GET]
  Traceback (most recent call last):
    File &quot;C:\Python310\lib\site-packages\flask\app.py&quot;, line 2073, in wsgi_app
      response = self.full_dispatch_request()
    File &quot;C:\Python310\lib\site-packages\flask\app.py&quot;, line 1518, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File &quot;C:\Python310\lib\site-packages\flask\app.py&quot;, line 1516, in full_dispatch_request
      rv = self.dispatch_request()
    File &quot;C:\Python310\lib\site-packages\flask\app.py&quot;, line 1502, in dispatch_request
      return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
    File &quot;C:\Users\MKyle\VSWorkspace\Covid-Data-Dashboard\back-end\app.py&quot;, line 10, in get_data
      return parse_week_by_week_bsu()
    File &quot;C:\Users\MKyle\VSWorkspace\Covid-Data-Dashboard\back-end\pullCovidData.py&quot;, line 37, in parse_week_by_week_bsu
      rstring+='{&quot;date&quot;: &quot;'+bsudate[i]+'&quot;,'
  TypeError: can only concatenate str (not &quot;float&quot;) to str
  127.0.0.1 - - [24/Nov/2021 17:25:23] &quot;GET /bsuweekdata HTTP/1.1&quot; 500 -
  </code></pre>
  <p>Repository Structure:
  <a href="https://i.stack.imgur.com/JgJHg.png" rel="nofollow noreferrer">Repository Files</a></p>
  <p>Please comment if you would like to see any of the other files or content and I will add as soon as I can if need be</p>
  <p><strong>parse_week_by_week_bsu method:</strong></p>
  <pre><code>def parse_week_by_week_bsu():
  pull_bsu_data()
  #fetches the main sheet out of the bsu google sheet
  bsumain = dfDictbsu['bsu_0']
  #gets the data coulmums for Date and weekly cases
  bsudate = bsumain['Date']
  bsuweeklycases = bsumain['Weekly_Cases']
  
  rstring = &quot;[&quot;
  i = 0
  length = len(bsudate)
  while  i &lt; length:
      rstring+='{&quot;date&quot;: &quot;'+bsudate[i]+'&quot;,'
      rstring+='&quot;cases&quot;: '+str(bsuweeklycases[i])
      if i+1 == length:
          rstring += '}'
      else:
          rstring += '},'
      i+=1
  rstring += &quot;]&quot;
  return rstring
  </code></pre>
  <p><strong>bsu_parse_cases_since_school_start method:</strong></p>
  <pre><code>def bsu_parse_cases_since_school_start():
      bsumain = dfDictbsu['bsu_0']
      start_index = bsumain.index[bsumain['Date'] == '8/12/2021']
      #total cases
      start_cases = int(bsumain['Total_Cases'].iloc[start_index])
      total_cases = int(bsumain['Total_Cases'].iloc[0])
      cases = total_cases - start_cases
      cases = {
          'Total': cases
      }
      return json.dumps(cases)
  </code></pre>