Skip to content

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

@R00118189

Description

@R00118189

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions