title: Getting error Refused to execute script from 'path' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled
body: <p>I am getting an error &quot;Refused to execute script from 'https://emortech.pages.dev/mai emortech.pages.dev/:1n.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.&quot; when I am trying running this deployed page on cloudflare. But when I am running this page on my localhost this error is not coming. Due to this error, the form is not working properly. I have also added type=&quot;text/javascript&quot; at the script tag in index.html.</p>
  <p>Code for  tag in index.html</p>
  <pre><code>&lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;
      &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;
      &lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.googleapis.com&quot;&gt;
      &lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.gstatic.com&quot; crossorigin&gt;
      &lt;link href=&quot;https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&amp;display=swap&quot; rel=&quot;stylesheet&quot;&gt;
      &lt;script src=&quot;https://cdn.tailwindcss.com&quot;&gt;&lt;/script&gt;
      &lt;script href=&quot;./style.css&quot; rel=&quot;stylesheet&quot;&gt;&lt;/script&gt;
      &lt;script type=&quot;text/javascript&quot; src=&quot;./main.js&quot;&gt;&lt;/script&gt;
      &lt;title&gt;Emortech&lt;/title&gt;
  &lt;/head&gt;
  </code></pre>
  <p>Code of Form Tag in index.html</p>
  <pre><code>&lt;div class=&quot;w-[20vw] z-10&quot; id=&quot;formContainer&quot;&gt;
              &lt;h1 class=&quot;text-4xl font-bold font-poppins&quot; id=&quot;formTitle&quot;&gt;Password Reset&lt;/h1&gt;&lt;br&gt;
              &lt;form class=&quot;tracking-wider font-semibold&quot; id=&quot;form&quot; onsubmit=&quot;return validatePassword();&quot;&gt;
                  &lt;label for=&quot;fname&quot;&gt;NEW PASSWORD&lt;/label&gt;&lt;br&gt;
                  &lt;input type=&quot;password&quot; id=&quot;newpass&quot; name=&quot;newpass&quot; class=&quot;h-9 border-black border-2 w-[100%] my-3&quot;&gt;
                  &lt;label for=&quot;lname&quot;&gt;RE-ENTER PASSWORD&lt;/label&gt;&lt;br&gt;
                  &lt;input type=&quot;password&quot; id=&quot;renewpass&quot; name=&quot;renewpass&quot;
                      class=&quot;h-9 border-black border-2 w-[100%] my-3&quot;&gt;&lt;br&gt;
                  &lt;div id=&quot;response&quot; class=&quot;text-red-500 italic text-xs&quot;&gt;&lt;/div&gt;&lt;br&gt;
                  &lt;button type=&quot;submit&quot; class=&quot;tracking-wide font-bold w-[100%] h-11 text-white bg-black rounded-lg font-poppins&quot;&gt;
                      RESET PASSWORD
                  &lt;/button&gt;
              &lt;/form&gt;
  </code></pre>
  <p>Code of main.js</p>
  <pre><code>function validatePassword() {
      const pass = document.getElementById(&quot;newpass&quot;)
      const cpass = document.getElementById(&quot;renewpass&quot;)
      const pattern = /\d/g;
      if (pass.value != &quot;&quot; &amp;&amp; cpass.value != &quot;&quot;) {
          if(pass.value.length &lt; 8){
              document.getElementById(&quot;response&quot;).innerHTML = &quot;Password must contain 8 characters&quot;
              return false;
          } else if(!pattern.test(pass.value)) {
              if (pass.value === cpass.value) {
                  document.getElementById(&quot;formTitle&quot;).innerText = &quot;Password Changed&quot;
                  document.getElementById(&quot;form&quot;).innerHTML = `&lt;p class=&quot;text-sm&quot;&gt;Your password has been updated! Now get back in the driver seat, racers are waiting for you!&lt;/p&gt;&lt;br&gt;&lt;button type = &quot;submit&quot; class=&quot;tracking-wide font-poppins font-bold w-[100%] h-11 text-white bg-black rounded-lg&quot; &gt;JOIN A RACE&lt;/button &gt;`
                  return false;
              } else {
                  document.getElementById(&quot;response&quot;).innerHTML = &quot;Passwords do not match&quot;
                  pass.className = pass.className + &quot; border-red-400 border-2&quot;
                  cpass.className = cpass.className + &quot; border-red-400 border-2&quot;
                  return false;
              }
          } else {
              document.getElementById(&quot;response&quot;).innerHTML = &quot;Password must contain only letters&quot;
              return false;
          }
      } else {
          document.getElementById(&quot;response&quot;).innerHTML = &quot;All fields are required&quot;
          pass.className = pass.className + &quot; border-red-400 border-2&quot;
          cpass.className = cpass.className + &quot; border-red-400 border-2&quot;
          return false;
      }
  }
  </code></pre>
  <p>Now this is the screenshot when I am running this code on localhost:3000
  No such error is coming and the form functionality is working fine. You can see a red font giving the desired output
  <a href="https://i.stack.imgur.com/YAuZp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YAuZp.png" alt="enter image description here" /></a></p>
  <p>Now when I run this same script deployed on cloudflare pages it given an error in the console and when I try to add values to input and submit the form an uncaught error occur and the page reloads
  <a href="https://i.stack.imgur.com/C8Zs8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C8Zs8.png" alt="enter image description here" /></a></p>