X-on:livewire-upload-error not emitted

This is in my component:

     public function updatedPhotosUp(){

    //validazione
    $this->validate([
        'photosUp.*' => 'image|max:4096', // 4MB Max
    ]);

     ......
}

this my blade

If I load an image the event “livewire-upload-finish” is emitted and the message “Upload completato” is displaied.
If I load a text file, not an image, the validation not let to load the file BUT the event “livewire-upload-finish” is emitted.

I think the “livewire-upolad-error” event has to be emitted.

Laravel 7
Livewire 2.2.3

Thank you!
Marco

The problem remains but i’ve found a solution to get around…

I use notyf for notification. I have to emit an event to show the message.

If validation is ok: I emit a success event from the php component after validation.
If validation fails: I use @error in blade and wih “<?php dispatchBrowserEvent…” I emit an error event.

my LW component

public function updatedPhotosUp(){

        //validazione

        $this->validate([

            'photosUp.*' => 'image|max:4096', // 4MB Max

        ]);

        $this->dispatchBrowserEvent('show-success-alert', ['message' => "Upload completato"]);

        // it's a nested component - I emit other event and from js i redirect to the right page
        // if I use php redirect I can't see the popup

        $this->emit('redirectMethod');

    }

blade