The Tailwind of my laravel project wont work

a month ago

Hi this is my first expirience deploying and web site, so i mitght be missing on something.

I managed do deploy my laravel site here, but the tailwind wont work, and i cant find any solution, what i think might be causing the problem is that, when i run it locally, i need to run php artisan serve and npm run dev, for it to work, but i think its only runing php artisan serve and i dont know how run both

$10 Bounty

6 Replies

It's likely there's something wrong with your code. If you paste it here we can help. Make sure to hide any sensitive info first.

First I suggest you ask Chat GPT to fix it for you. Maybe it's that simple. If it's something else, then we go from there.


a month ago

Make sure to check if you have set up Vite/Webpack correctly to use Tailwind in your Laravel project. Usually the most common issues is you did not set up your Vite configuration properly

Refer to Install Tailwind CSS with Laravel - Tailwind CSS for more info.


testuser123

It's likely there's something wrong with your code. If you paste it here we can help. Make sure to hide any sensitive info first.First I suggest you ask Chat GPT to fix it for you. Maybe it's that simple. If it's something else, then we go from there.

a month ago

It works locally tho, is there any config that i need to do diferrent for it to run on a server? what i think might be causing the problem is that, when i run it locally, i need to run php artisan serve and npm run dev, for it to work, but i think its only runing php artisan serve and i dont know how run both


sr229

Make sure to check if you have set up Vite/Webpack correctly to use Tailwind in your Laravel project. Usually the most common issues is you did not set up your Vite configuration properlyRefer to Install Tailwind CSS with Laravel - Tailwind CSS for more info.

a month ago

It works locally tho, is there any config that i need to do diferrent for it to run on a server? what i think might be causing the problem is that, when i run it locally, i need to run php artisan serve and npm run dev, for it to work, but i think its only runing php artisan serve and i dont know how run both


emerzz35

It works locally tho, is there any config that i need to do diferrent for it to run on a server? what i think might be causing the problem is that, when i run it locally, i need to run php artisan serve and npm run dev, for it to work, but i think its only runing php artisan serve and i dont know how run both

Oh, so if it's running locally you need to build the Tailwind CSS as part of the deploy, not just locally. Once you do, it will show up on the live site.

Go to settings and add a “Build Command” like:npm install && npm run build.Your “Start Command” should only start the PHP server (like php artisan serve or php-fpm), not the build step. Btw, check if your deployments aren't ignoring the built files like .builtignore


emerzz35

It works locally tho, is there any config that i need to do diferrent for it to run on a server? what i think might be causing the problem is that, when i run it locally, i need to run php artisan serve and npm run dev, for it to work, but i think its only runing php artisan serve and i dont know how run both

a month ago

Another thing that I should point out is make sure you have set up your web server configuration properly, do not use php artisan serve on production.


The Tailwind of my laravel project wont work - Railway Help Station