Apperance changed in production environment
I have deploy mi filament app in railway, and all works fine. But when render page, some style is different that local environment. Background form fields are white color and his text is white too. In dashboard doesn't show title app, and the side menu are out of square with main content. I am using default theme, and try with ligth and darkmode. Can you help me to found problem and solve it??
19 Replies
Try ‘php artisan filament:upgrade’ on your server.
Already upgrade filament, but not solve the problem
Perhaps your browser has cached older versions of the files?
Perhaps your server is doing some asset caching, and not serving the updated assets?
Use browser dev tools to inspect the actual css/js files that it is receiving from the server, and compare those with what "should" be served. Then sort out the problems after that.
Cache dont seems to be the problem. Try it with other browser and devuces with same result local instance render ok and production instance is not ok.
I create a new project to deoloy other instance (in Railway) but a have same result
Are you using a custom theme by chance?
Is the browser reporting any Network errors when loading any CSS files?
Is there a version number appended to the URL for loading the css files? What is it? and does that match your Filament version?
And, again, is the CSS that the browser is receiving actually matching the expected CSS that you pushed to the production server? If what your browser is receiving doesn't match what you pushed to the server, then the server is serving something cached/stale. But if all the css files received by the browser are the same as what you pushed to production, then the problem is elsewhere ... probably in files that got missed in the deployment.
Try npm run build
Hi, there arent errors loading CSS
yes, has version appended to URL
i check version appended in local and production, and is not the same
local version is 3.0.45.0
Hi, railway person here - are you using the default PHP builder?
and production version is 3.0.79.0
sorry, i dont understand your question
Are you using a Dockerfile/have you changed your build or deploy settings at all?
i deploy production in railway
connecting with github project with the same code and config (except bd credentianls) that local
this is my nix command :
NIXPACKS_BUILD_CMD=npm run build && php artisan optimize:clear && php artisan cache:clear && php artisan config:clear && php artisan config:cache && php artisan filament:upgrade
Try removing the build command - the PHP provider has a lot of carefully-balanced stuff that's easily broken by custom configs
could you try?
app/Http/Middleware/TrustProxies.php
protected $proxies = '*';
i have force https and ll proxies already, because without this in production dont work fine
tring to redeploy without build, same result.
logs to deploy:
[Region: us-west1]
==============
Using Nixpacks
==============
context: 3e75f31e1a070abf0acc2f4b96df744e
╔══════════════════════════════ Nixpacks v1.17.0 ══════════════════════════════╗
║ setup │ (php81.withExtensions (pe: pe.enabled ++ [])), perl, nginx, ║
║ │ libmysqlclient, php81Packages.composer, nodejs_18, npm-9_x ║
║──────────────────────────────────────────────────────────────────────────────║
║ install │ mkdir -p /var/log/nginx && mkdir -p /var/cache/nginx ║
║ │ composer install --ignore-platform-reqs ║
║ │ npm i ║
║──────────────────────────────────────────────────────────────────────────────║
║ build │ php artisan optimize:clear && php artisan cache:clear && php ║
║ │ artisan config:clear && php artisan config:cache && php artisan ║
║ │ filament:upgrade && php artisan --version ║
║──────────────────────────────────────────────────────────────────────────────║
║ start │ perl /assets/prestart.pl /assets/nginx.template.conf ║
║ │ /nginx.conf && (php-fpm -y /assets/php-fpm.conf & nginx -c ║
║ │ /nginx.conf)
Hum, I don't know
try to add in your .env
ASSET_URL=https://yoururl
Asset url is setted with https, because dont load css with http
Could you join the Railway discord and make a help thread there? (and ping me (@aleks) in - you can send a screenshot of this message if someone says "rule #5") https://discord.gg/railway
At this point I'm pretty sure this is a Railway issue
Done! Thanks @root