Missing tailwind classes; how to fix it ?
I added tailwind classes but it seems not all tailwind classes are working. how do I fix this issue?

71 Replies
import-instructions.blade.php
You need to create a custom theme, although you don't have to actually customize anything.
https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme
What are the next steps after doing this?
I have installed the custom theme using
php artisan make:filament-theme
Hi, I am running to this issue but I already ran the
npm run buil / dev
Do you know the reason of this issue?
Check whether you followed all the steps from the Theme docs. Is the file included in Vite config?
I already did this on the main panel

I do not have vite.config but only tailwind.config.js
@Dennis Koch
Should I add vite.config.js ?
yeah, you need one
https://laravel.com/docs/12.x/vite
i'm not sure how you don't have one already though
So this is what I did, will have to check the outcome

Wondering if this works
resources/sass/app.scss
since i do not have app.cssIf you don't have one, don't add it 😅
if you are using scss, then
npm install -D sass-embedded
should make your config workStill the same issue


What to do after installing this package
does your package.json have the dev script that runs vite?
i dont see vite in the config
package.json
I am using laravel-mix
ohhhh, i'd convert your project to using vite. i don't think Filament is compatible with mix
you meant laravel-mix ?
crap this is a big issue
for me though
laravel shift make it easier?
Well I cant easily update the project since this project is quite big.
oh, they've also got a shift that convert mix to vite
How am I able to run the Filament if it doesnt support vite? (although i am using mix)
A little bit Confucius
if you aren't building anything, then it's just using the files copied from the package to your public directory
vite might still work if you remove your files and just use for filament
i'm not familiar with herd, but maybe "npx vite" will work
Will take a look into it..
It doesnt overwrite anything right?
it just installs the vite
shouldn't, as long as you remove those other. your production might need to be "mix --production && vite build". i dunno if it will create conflicting manifest files though
biting the bullet and converting to vite will be most stable long-term
xd hmm, i see quite risky i might have to re-setup this project locally incase it goes haywire
Thank you for the insights 🙂
btw, the vite converter on laravel shift is free
Nice, good to know!
good luck!
Please don't tag people.
Appologies
I am at the stage where I've updated the mix to vite but this is whats happening on my local

There are so many errors on the console side

The first ones look, like your Vite server isn't running or reachable. Also the last one.
But it seems to be working fine when I do npm run dev
This happens when I do not execute npm run dev

You need to run ‘npm run build’ too. And during your deployment when you get to that point.
They removed the npm run build
wait
nvm
I will try
Why is it js are not working anymore after migrating to vite
Hard to tell. Vite works not 100% the same as Webpack. Sometimes modifications are necessary.
This one specifically


Shouldn't it compile because I referenced the file ?
Looks like an issue in your js, seems like jquery isn’t getting loaded. Mix might have been pulling vendors out into a separate js which isn’t getting created and managed by vite or loaded in the layout.
Hi, the app.js have this import code
import './bootstrap';
which contains this load jquery thing

Looks ok to me, so something else is calling jquery’s $ before its loaded.
Why is this happening, ?

I added a console for the catch
in vite we dont use require() anymore?
updated the code to this
No error now on the console
BUt holycrap theres still a lot of errors

Modern vite prefers imports instead of require, but i would still think it would work. But could be that it needs to be a .cjs instead of .js
Definitely alot, just take them one by one.
I dont get this one do you have any idea with this?

Imports need to be at the top of the file.
Okay will try that
You shouldn’t need a try on the imports, if it cant import them during the build it will throw an error anyway.
okay
Why is that I cant import inside the try catch?

but on the previous version it is ok?
Seems to fix the issue you recommend
I really hate the configuration issues so hard to fix
haha look at the websocket it can't even connect
And I dont even know how to fix this
You’re going to have to go through your mix file and see what the difference’s are. First step is getting everything to build properly.
The socket is the least of your concerns at the moment.
Okay
Get it to build correctly. Then go from there with the 404s
After that its likely the socket will correct itself.
The site is working acutally and building
its just that previously none of the js actions were working

Theres even a package error that I don't know if I should touch this or know how to even fix this one

Anyway thanks for helping me
Yea, hard to help with 3rd party package errors, especially since i don’t use them. Sorry.
I will say though that there are conflicts with using tailwind and bootstrap in the same app, so be aware of that.
what
so I cant use filament here?
Filament uses tailwind and I also need to use tailwind
I need to install tailwind though so that I can keep building new classes
You can use filament, but you need to understand that it uses tailwind and tw has conflicts with bootstrap so you’ll have to figure out how make them play nice or drop bootstrap.
Yeah, I understand, class conflicts right?
i wonder if I could just do a
tw-
for all tailwind classesYou could if it wasn’t filament. Adding tw- to all the filament views would be 1000x more difficult to maintain. If you need a prefix, it would be better to do it to bootstrap, if possible. Been a while since I’ve done anything with it.
In general though, they are 2 different things and getting them to play nice together will ultimately be more trouble than it’s worth, IMHO.