Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#138 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
laravel, php
Ambito
backend, frontend

Direzione di ricerca

Inizia riproducendo il malfunzionamento con la chiamata Volt::mount() del ServiceProvider del pacchetto e l’entry Volt::route() in routes/web.php. Traccia come viene individuato e compilato il percorso montato resources/views/livewire, quindi verifica che la route vendor-package::section.example-component venga renderizzata correttamente senza generare una ComponentNotFoundException.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
PHP
Stelle
422
Fork
35
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di livewire/volt

Tutte le issue di livewire/volt

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.