Modernizr is not defined. A very simple browser check but not working?

Modernizer is not working.
my console here

Trying to check for browsersupport with css grids.

My script in the HTML file:

<!-- Browser support check using Modernizer -->
  <script  src="../src/modernizr.js"></script>
  <script>

    if (Modernizr.cssgrid, cssgridcssgridlegacy) {
      alert('ok!')
    } else {
      alert('no ok!')
    }

  </script>

  <!-- End browser support check -->

I have modernizr-config.json and modernizr.js files in my src folder. index.html in my public folder. Overall a React app.
Basically I followed this guide here: https://www.youtube.com/watch?v=wnMiH-_B6wg

What’s going on? What have I missed?