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

srd9's avatar
Level 3

Vite is not working anymore

Hi everyone sorry to bother you.

I worked with Vite and Tailwind CSS before without any problem in Laravel v9.20 and it was perfect.

Today I installed a fresh Laravel (v9.23) and Tailwind CSS (through the documentation and config it properly). When I use "npm run dev" which is "vite" it will run vite but tailwind styles are not applied, But when I use "npm run build" it builds it correctly and styles are applied. If I run the dev script again, all the applied tailwind styles will go away again.

I really don't know what is the problem. It worked fine in the past. I Appreciate your help in advance Thanks

0 likes
5 replies
Sinnbeck's avatar

Check the browser console while dev is running

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@sina93 set the server manually in the vite config

server: { 
        host: 'localhost', 
    }, 
srd9's avatar
Level 3

@sinnbeck Many many thanks! It worked! I feel very stupid but I tried many times and it failed and now I am happy :)) Thanks <3

Please or to participate in this conversation.