livewire / livewire/volt

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

Open
#138 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
423
Forks
36
PR merge metrics
No merged PRs in 30d

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.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:

```php
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`:

```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`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the package ServiceProvider's Volt::mount() call and the Volt::route() entry in routes/web.php. Trace how the mounted resources/views/livewire path is discovered and compiled, then verify that the vendor-package::section.example-component route renders successfully without ComponentNotFoundException.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
backend, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.