filament:upgrade causing asset changes in certain dev envs
I am working on a project where running
php artisan filament:upgrade
on a fresh git clone works without issues. However in one dev env, running that results in file changes to the published assets in /public/
. Normally I would only expect for that to happen after a composer update
but in this case only composer install
was run. Has anyone ever experienced this problem under certain Windows local dev environments?9 Replies
If you ran filament:install then it adds the upgrade script to your composer.json which will always republish the css and js assets. Which is actually what you want to happen.
Right, in 3 out of 4 dev envs that is working as expected. But for some reason on one Windows env it republishes as expected, but then modifies all of the js/css assets (despite no changes to composer.lock). So I'm trying to figure out if this is a known issue with an older version of composer on Windows or what. Going to try switching that env to Herd I guess.
The problem is after
composer install
it's resulting in like 20 file changes in just this one env when normally you would only expect that after a composer update
or something if Filament changed a bunch of things.
As if composer is re-publishing the assets slightly differently in this one env for some reason. That's what I'm trying to figure out.Well, any one patch version of filament could potentially republish 20 files since they are all getting regenerated during filaments build with a new version hash
All of the filament components that have alpine components are separate js files so they can be loaded on demand.
Right I'm aware of all of that, but in this case it's with a locked Filament version so there is no upgrade being done just an install where all the JS/etc assets are already published and already committed. So it has to do with composer re-publishing the same assets but differently which is causing modifications. That's what I'm confused about. So I don't know if it's an older version of composer causing the issue, or some weird composer configuration problem. In all other envs it republishes the assets upon composer install but there are no changes. In the troublesome env, it republishes all assets as expected but it modifies all the files. This is with the exact same composer.lock so Filament version being used is not changing. I've been using Filament for nearly 3 years and never seen this before. I think it's more of a composer issue than Filament. So just wondering if anyone else has seen something like this.
Ok. I’m just saying that filament:upgrade runs filament:assets so it will republished the assets from filament at that particular version even if it is locked. But there certainty could be some weird things happening as a result of composer on windows which does have some odd ‘bugs’ around version numbers on windows. Can you verify the differences in the published assets, ie they are actually different files?
OK I'll try to remember to report back if switching over to Herd on Windows resolves the issue.
I was able to reproduce the problem in a new Windows+Herd environment. Really not sure of a resolution.
What is the actual issue that is happening? Ie what is being affected or breaking?
@awcodes I created an issue for this with easily reproducible steps https://github.com/filamentphp/filament/issues/14278
GitHub
Windows republishes assets differently than Mac/Linux dev env, caus...
Package filament/filament Package Version v3.2.98 Laravel Version v11.20.0 Livewire Version v3.5.4 PHP Version PHP 8.3.11 Problem description When I composer install a Filament project in a WIndows...
Shouldn’t these be git ignored, though?