Vite assets / npm run build - loads new theme once, then only loads vendor theme

Posted this on GH discussions a few days ago, no responses there so I figured I'd try my luck here for some more visibility. This issue feels super weird and I'm not sure how to investigate it further or if I should file an actual issue report. I've followed the appearance customisation instructions. On my local it works fine. On my production instance, on a fresh asset build, Filament will correctly use the built asset filament.css for the theme once, but subsequent loads just uses the vendor Filament CSS. Viewing page source shows this link change. I've even added logging in the service provider to log Filament::getThemeLink() and on each page load (even when it's defaulting to the vendor one in the page source) and it's always the built asset. I'm using Octane if that matters at all?
5 Replies
NikSpyratos
NikSpyratosOP2y ago
Gist containing my vite, tailwind and filament.css: https://gist.github.com/nikolaos-spyratos/874fb0c683199f1ca55c15927575f1e2
Gist
Filament theme issues
Filament theme issues. GitHub Gist: instantly share code, notes, and snippets.
wyChoong
wyChoong2y ago
How are you registering the custom theme
NikSpyratos
NikSpyratosOP2y ago
Filament::registerViteTheme('resources/css/filament.css');
Dan Harrin
Dan Harrin2y ago
where did you put it
NikSpyratos
NikSpyratosOP2y ago
aaaaaaah PEBCAK of course. I had the theme register outside the Filament::serving block. Putting it inside it fixed the problem. Shouldn't try coding this stuff late at night 💤
Want results from more Discord servers?
Add your server