volt icon indicating copy to clipboard operation
volt copied to clipboard

Volt components inside packages not recognized or compiled despite Volt::mount() setup

Open R00118189 opened this issue 5 months ago • 1 comments

Volt Version

1.7.1

Laravel Version

12.21

PHP Version

8.4.10

Database Driver & Version

No response

Description

Volt components placed inside a Laravel package are not recognized or compiled, even when mounted using Volt::mount() from the main application.

Despite the following being correctly configured:

  • The .blade.php component exists in the expected path inside the package
  • The namespace is properly registered via Volt::mount()
  • The route is defined with the correct namespace and path
  • All caches are cleared (view:clear, optimize:clear, composer dump-autoload, etc.)

Volt throws:

Livewire\Exceptions\ComponentNotFoundException  
Unable to find component: [vendor-package::section.example-component]

These same components work fine when placed inside the main application’s resources/views/livewire folder, which confirms that Volt is not compiling or registering them from mounted package paths.

Steps To Reproduce

  1. Create a Laravel package (e.g. vendor/package-name)

  2. Inside the package, add a Volt component file at:

    resources/views/livewire/section/example-component.blade.php
    
  3. In your package’s ServiceProvider, mount the Volt views using:

    use Livewire\Volt\Volt;
    
    public function boot(): void
    {
        Volt::mount(
            __DIR__ . '/../resources/views/livewire',
            'vendor-package'
        );
    }
    
  4. In the main Laravel application, define a Volt route in routes/web.php:

    use Livewire\Volt\Volt;
    
    Volt::route('settings/example', 'vendor-package::section.example-component')
        ->name('settings.example');
    
  5. Run:

    php artisan optimize:clear
    composer dump-autoload
    
  6. Visit /settings/example in the browser

Expected: The Volt component renders normally ❌ Actual: Livewire throws a ComponentNotFoundException

R00118189 avatar Jul 27 '25 23:07 R00118189

Hey everyone,

Laravel 12 and Livewire 3.6 are out, but this package doesn’t officially support them yet. If you’re using Volt and planning to upgrade (or already have), it’d help to raise visibility by commenting or reacting when someone opens an issue about compatibility.

Let’s make sure Volt stays up-to-date with the ecosystem.

quansho avatar Jul 30 '25 14:07 quansho