F
Filamentβ€’15mo ago
Sanchit Patil

viteTheme not working on Production

Hello All, I am using a custom theme with filament, and it is working perfectly locally. (both with npm run dev & build) but not working on production. Vite is still using this syntax to load the custom theme files on the production <script type="module" src="http://[::1]:5173/@vite/client" data-navigate-track="reload"></script><link rel="stylesheet" href="http://[::1]:5173/resources/css/filament/admin/theme.css" data-navigate-track="reload" /> my env file is set to production, i have cleared all the cache, remove node_modules and install it again on production site build on production, but still, it is not working. provider: ->viteTheme('resources/css/filament/admin/theme.css') vite.config.js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/filament/admin/theme.css'],
refresh: true,
}),
],
});
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js', 'resources/css/filament/admin/theme.css'],
refresh: true,
}),
],
});
theme.css
@import '../../../../vendor/filament/filament/resources/css/theme.css';

@config './tailwind.config.js';

:root {
--filament-progressbar-color: #22c55e;
}
@import '../../../../vendor/filament/filament/resources/css/theme.css';

@config './tailwind.config.js';

:root {
--filament-progressbar-color: #22c55e;
}
tailwind.config.js
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./resources/views/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
plugins: [require("daisyui")]
}
import preset from '../../../../vendor/filament/filament/tailwind.config.preset'

export default {
presets: [preset],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./resources/views/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
plugins: [require("daisyui")]
}
Could anyone please help me? Thank you. πŸ™‚
6 Replies
awcodes
awcodesβ€’15mo ago
Check you APP_URL in you env. That url is not correct.
Sanchit Patil
Sanchit PatilOPβ€’15mo ago
APP_URL is set to production domain only. Still viteTheme trying to load css from local. Even tried with this
@vite(['resources/css/app.css', 'resources/js/app.js']) But same error.
Hasnayeen
Hasnayeenβ€’15mo ago
did you cleared your cache after changing env values?
Sanchit Patil
Sanchit PatilOPβ€’15mo ago
Yes, cleared config, views and routes & cache
Watoka
Watokaβ€’15mo ago
Add to your deploy script:
npm ci
npm run build
npm ci
npm run build
Sanchit Patil
Sanchit PatilOPβ€’15mo ago
Thank you all, the issue was "hot" file. which is accidentally deployed on production. I just removed the hot file form the public directory and it is working now.
Want results from more Discord servers?
Add your server