Metronic8 React TypeScript Vite Build not working in Production!
Hi Developers!
Here I am using Metronic 8 React Version build on Vite.
I am facing issue in build running locally running index.html file using live server.
Its working Fine with npm run dev, npm run build, npm run preview.
but when I running build locally its giving these Errors.
because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Replies (3)
Hi,
Thank you for reaching out to us.
Could you please specify which Metronic version you are using?
npm run preview is the command you can use to test your build locally if you are using some custom local server to test build the error could be related to your server setup.
Regards,
Lauris Stepanovs,
Keenthemes Support Team
In npm run preview build is working fine but when i run the build local with direct index.html using live server its not working.
But now i figure it out that issue is in base url set in the vite.config.ts
base: "/", (Now i set to this) so its working fine.
Thankyou
Best Regards
Divyansh Singh
Software Engineer
Hi,
I'm glad to hear you managed to fix this. Yes, the base path should be configured according to your server's path.
Please let me know if you need any additional help on this topic or anything else.
Regards,
Lauris Stepanovs,