Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ChristYoga's avatar

Success building Vite in my Laravel 9 App but the CSS and JS wasn't called in my page

I have an app that is deployed in shared hosting. I already run npm run build and the result is success transforming. But when I came back to my website, the transformed CSS and JS wasn't called in my page and give me error like mime-type (text/html) not allowed. I dont give a link tag to connect with my CSS and JS file. just using @vite

Can anyone help me? I really appreciate it

0 likes
2 replies
vincent15000's avatar

Do you include the CSS and JS inside the head tags ?

1 like
ChristYoga's avatar

No. I haven't because when I test it in local, when I use npm run build and success, I don't have to give link to my css and js file. But I don't know if there any differences between testing in local and when you deploy it in server. Is it a must to link it when my laravel vite in production env?

Please or to participate in this conversation.