MIME type issues with functions?

Refused to execute script from 'https://example.com/myfunction.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
CODE:
<!DOCTYPE html>
<html>
  <head>
    <script src="./myfunction.js"</script>
  </head>
  <body>
    <button onclick="bodyTest()">TEST</button>
  </body>
</html>

function bodyTest(){
  return("hello, world!");
}

I am not exactly sure what I am doing wrong..
Was this page helpful?