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

kikter's avatar

How do i install laravel 9 vite on shared hosting successfully

Hello happy Sunday, since the introduction on laravel vite it has been really difficult for me to install laravel 9 on shares hosting without encountering STYLES issue

The CSS won't render the @vite([]) isn't getting the CSS and js file

If you have deploy a project on shared Hosting without encountering this issue please help

0 likes
7 replies
Sinnbeck's avatar

Build the assets locally and upload them to the shared host along with all other files. What error are you getting?

kikter's avatar

@Sinnbeck I have done that after building the assets locally, the website works no errors but the vite directive isn't getting the assets file location

kikter's avatar

@sinnbeck I wish there is a video or write that shows how to deploy laravel 9 vite on shared hosting

Sinnbeck's avatar

@kikter sadly I don't think many people make videos on shared hosting. Can you perhaps share the url so we can inspect it?

Sinnbeck's avatar

@kikter that seems to be styled? Be aware that the site currently works without https. You should redirect http to https

waqaspuri's avatar

@Sinnbeck This seems interested to me, As i'm having issue related to the shared hosting too. the project works fine in the localhost. for e.g.

<img src="{{ Vite::asset('resources/images/600400.png') }}" alt="" sizes="" srcset="">

project url https://websol.biz/laravel9/public/

but since it doesn't work in the shared hosting ? since you mentioned that something like that, "build the assets locally and upload it to the server" as you knew in the shared hosting can't run the npm run dev. or npm instal so my question is, it possible that i can build it via Vite and then move the project to the /shared hosting and use the assets from build folder.

(no nodejs) in the server. also

Please or to participate in this conversation.