volt icon indicating copy to clipboard operation
volt copied to clipboard

ValidationException breaking Volt

Open leandroneves-net opened this issue 7 months ago • 0 comments

Volt Version

1.7.0

Laravel Version

12.14.1

PHP Version

8.3.6

Database Driver & Version

No response

Description

Using $validator->validate() on a service cause the following error on blade: Uncaught Snapshot missing on Livewire component with id: v8Azl0xMTGnP3s95KjPz

If I rewrite the code to

        try {
            $validator->validate();
        } catch (ValidationException $e) {
            Log::error('Validate() error: ' . $e->getMessage());
            throw new \InvalidArgumentException('Validate() error: ' . $e->getMessage());  
       }

The program works fine.

Steps To Reproduce

Using $validator->validate() on a service cause the following error on blade: Uncaught Snapshot missing on Livewire component with id: v8Azl0xMTGnP3s95KjPz

If I rewrite the code to

        try {
            $validator->validate();
        } catch (ValidationException $e) {
            Log::error('Validate() error: ' . $e->getMessage());
            throw new \InvalidArgumentException('Validate() error: ' . $e->getMessage());  
       }

The program works fine.

leandroneves-net avatar May 19 '25 00:05 leandroneves-net