# Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec

**URL:** <https://answers.netlify.com/t/failed-to-load-module-script-expected-a-javascript-module-script-but-the-server-responded-with-a-mime-type-of-text-html-strict-mime-type-checking-is-enforced-for-module-scripts-per-html-spec/122743>\
**Category:** Support\
**Tags:** deployment, create-react-app, redirects, netlify-newbie\
**Created:** [July 23, 2024, 11:53pm UTC](https://answers.netlify.com/t/failed-to-load-module-script-expected-a-javascript-module-script-but-the-server-responded-with-a-mime-type-of-text-html-strict-mime-type-checking-is-enforced-for-module-scripts-per-html-spec/122743 "2024-07-23T23:53:38Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![nathanmartin](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/nathanmartin/32/30845_2.png) [@nathanmartin](https://answers.netlify.com/u/nathanmartin)\
**Post date:** [July 24, 2024, 7:25am UTC](https://answers.netlify.com/t/failed-to-load-module-script-expected-a-javascript-module-script-but-the-server-responded-with-a-mime-type-of-text-html-strict-mime-type-checking-is-enforced-for-module-scripts-per-html-spec/122743/6 "2024-07-24T07:25:18Z")

</div>

@LXTKay When you run your build locally, what do you see in the `/dist/index.html` file?

When I run your build:

![image](https://global.discourse-cdn.com/netlify/original/3X/8/9/89bc1e87c8500b94feb244b54ba46bd43b60d614.png)

I see the following in `dist/index.html`:

```auto
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Blog Frontend</title>
    <script type="module" crossorigin src="/assets/index-BCGdcLZB.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/index-DLK3Qp-W.css">
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>

```

I’d expect the build on Netlify to be the same.

That said, this looks like it’d probably be the culprit here:

> <https://github.com/LXTKay/blogFrontEndAuthor/blob/deployBranch/vite.config.js#L7>

---

_[View the full topic](https://answers.netlify.com/t/failed-to-load-module-script-expected-a-javascript-module-script-but-the-server-responded-with-a-mime-type-of-text-html-strict-mime-type-checking-is-enforced-for-module-scripts-per-html-spec/122743)._
