Production-only problem with FileUpload - on first upload the state is reset
Hey there!
FileUpload triggers one more update livewire request after successfull upload and resets the state to empty. (checkout provided video)
Valid upload (local):
Upload process triggers two update requests and one upload-file.
Invalid upload (production):
Upload process triggers THREE (check out screenshot) requests with the last request reseting the state.
Note: Yeah, it is the same code deployed on production as locally. Double checked.
Can anyone try to explain please why is there this one more update trigger?
Interesting thing is that this happens only on production deployment. Locally it works perfectly fine.

Solution:Jump to solution
It sounds like the delployed code ins't mounting the form first for some reason... usually $this->form->fill() on mount
12 Replies
Solution
It sounds like the delployed code ins't mounting the form first for some reason... usually $this->form->fill() on mount
Funny, thanks @toeknee, the $this->form->fill() was the last line in mount. When i moved it to be first, it works now! thx.
Welcomes
@toeknee Sorry to bother u again... I noticed it also happens inside create/edit form of any resource inside panel that has FileUpload in it. First upload resets and then it works when uploaded second time. Is there any $form->fill() possibility in panel resource forms ? Or what could be the issue ? Many thanks.
Panel should be form filled already... That is strange, can you confirm you are on the latest Filamentphp version/
Thanks it is resolved now. I had just some cache on the production which I thought I deleted but it wasnt.
hey @Michal , got the same issue, but the fill don't solve it and i have the same issue locally and in prod... Any way you could help ?
Hey, also try running artisan optimize:clear π
still don't work :/
in my networ tab, i've got 2 call to update, one without the file and one right after the file, i think the first one triggers a UI update but not the second one, don't know why ..
maybe @toeknee have an idea ? π
Is it custom form or inside panel ?
Can you chuck together a reproduction repo so we can download it, seed and test?
it's inside a filament modal
will try to do a demo repu next week..