-
Notifications
You must be signed in to change notification settings - Fork 32
Description
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.phpcomponent 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
-
Create a Laravel package (e.g.
vendor/package-name) -
Inside the package, add a Volt component file at:
resources/views/livewire/section/example-component.blade.php -
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' ); }
-
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');
-
Run:
php artisan optimize:clear composer dump-autoload -
Visit
/settings/examplein the browser
✅ Expected: The Volt component renders normally
❌ Actual: Livewire throws a ComponentNotFoundException