PLEASE help us help you by writing a good post!
- we need to know your netlify site name. Example:
gifted-antelope-58b104.netlify.app
- DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
- Build problems? Link or paste the FULL build log & build settings screenshot
The better the post - the faster the answer.
Site Name : https://master--illstrs.netlify.app/
I’m using vite and react for my application. This is my vite config file:
This is my index.html code
<!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>Vite + React + TS</title>
<link rel="stylesheet" type="text/css" href="index.css" />
</head>
<body>
<div id="root"></div>
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Amatic+SC" />
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
This is my main.tsx code
const router = createHashRouter([
{
path: "/",
element: <App />,
},
{
path: "/Home",
element: <Home />,
},
{
path: "/category/:gender/:category/:page",
element: <Category />,
},
{
path: "/product/:item/:color",
element: <Product />,
},
{
path: "/account/login",
element: <UserLogin />,
},
{
path: "/account/registration",
element: <UserRegistration />,
},
{
path: "/account/user-logged-in",
element: <SignedIn />,
},
{
path: "/account/login-recover",
element: <PasswordReset />,
},
{
path: "/search/:page",
element: <SearchResults />
},
{
path:"/user/collection",
element: <Collection />
}
]);
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<RouterProvider router={router} />
</React.StrictMode>
);
I also happen to get this error:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “application/octet-stream”. Strict MIME type checking is enforced for module scripts per HTML spec.
If someone can help me that would be greatly appreciated