Select and media upload not loading and working correctly

I’ve built an admin panel using Filament, Filament Forms, and Spatie Media Library Upload. However, I’m encountering issues in production where two of my components are not loading correctly, and I’m seeing multiple AlpineJS errors. Strangely, everything works perfectly in my local environment. Issue: When using Filament Forms and Spatie Media Library together in production, two of my components fail to load correctly, and I see numerous AlpineJS errors in the console. No issues on local environment. Errors occur only in production. What I’ve Tried: Reinstalling AlpineJS. Upgrading Laravel and all packages to Laravel 12 (this issue occurred on Laravel 11 as well). Publishing all config files. Running npm run build multiple times. Despite these attempts, the issue persists in production, and I’m still encountering AlpineJS-related problems. Additional Context: The problem began when I added the Spatie Media Library plugin to my project. It seems like a possible conflict with Livewire and AlpineJS, but I can’t pinpoint the exact cause. Local Environment: Works flawlessly. Production Environment: Errors and broken components. Expected Behavior: The components should work the same way in production as they do locally, without any AlpineJS errors. Screenshots/Logs: I’m happy to provide console logs or screenshots if needed. Questions: Are there any known conflicts between Filament, AlpineJS, and Spatie Media Library? Could this be an issue with how assets are compiled for production? Do I need to configure Livewire, AlpineJS, or Filament differently in production? Any guidance or advice on how to resolve this issue would be greatly appreciated!
No description
Solution:
@Leandro Ferreira The problem has been solved now. I did not have the correct filament javascript files in my root folder.
Jump to solution
34 Replies
LeandroFerreira
share the console errors
Floris
FlorisOP3d ago
No description
No description
No description
No description
No description
No description
No description
No description
No description
Floris
FlorisOP3d ago
No description
LeandroFerreira
does it work if you remove Spatie Media Library ?
Floris
FlorisOP3d ago
Remove the whole thing from the filament panel?
LeandroFerreira
you said: The problem began when I added the Spatie Media Library plugin to my project. does it work if you remove it?
Floris
FlorisOP3d ago
Good one! will check it when I come home.
Floris
FlorisOP3d ago
No, now the skills used is still the same.
No description
LeandroFerreira
weird.. I've never seen this error before.. 🤔
Floris
FlorisOP3d ago
I've gotten 2 warnings and 2 errors less in my console 🫡
LeandroFerreira
you mentioned that it works locally, right?
Floris
FlorisOP3d ago
Yep, perfectly
LeandroFerreira
could you run php artisan filament:assets php artisan filament:optimize-clear ?
Floris
FlorisOP3d ago
Done! Sadly no results
LeandroFerreira
what server/service are you using to deploy it?
Floris
FlorisOP3d ago
Siteground
LeandroFerreira
php artisan vendor:publish --force --tag=livewire:assets ?
Floris
FlorisOP3d ago
I've got another website hosted at siteground, but everything is working fine there. now my screen is completly black edit: i have moved the folder that was placed in the public folder to the root folder, now my screen is not black but nothing changed/.
LeandroFerreira
this command publishes livewire files here public/vendor/livewire any console errors?
Floris
FlorisOP3d ago
yeah but now 20 less!
LeandroFerreira
I mean, with black screen
Floris
FlorisOP3d ago
No description
Floris
FlorisOP3d ago
oh didn't check...
Floris
FlorisOP3d ago
No description
Floris
FlorisOP3d ago
I am gonna move the directory back.
Floris
FlorisOP3d ago
No description
LeandroFerreira
does it happen when you login?
Floris
FlorisOP3d ago
Thats the error that the vendor file is not placed in the root folder. when I place the vendor file in the root folder, the process continues but as anwer on your question: yes.
LeandroFerreira
Livewire issue in your server I think But I don't have idea how to solve it
Floris
FlorisOP3d ago
I can try to deinstall livewire lol
LeandroFerreira
php artisan vendor:publish --force --tag=livewire:assets should solve it you can try it open a ticket on Siteground support.. maybe they can help you
Floris
FlorisOP3d ago
filament/support v3.3.3 requires livewire/livewire (^3.5) shit thanks
Solution
Floris
Floris20h ago
@Leandro Ferreira The problem has been solved now. I did not have the correct filament javascript files in my root folder.

Did you find this page helpful?