Unable to find component: [***]

I’m sure I’m missing something stupid but I’m stucked with this error on my first component, maybe someone can help me:

I’m developing a package inside a laravel 7.1 app.
Livewire is reuired and installed in the app Laravel
Livewire components works in Laravel resources/view
I did register the component in my [packagename]Serviceprovider.php

But I have 2 issues that I’m sure are related to the same problem:

  1. If I try to use Route::livewire(…whatever…) I get a “Attribute [livewire] does not exist.”

  2. If I try to include my component inside blade using @livewire(‘path.to.component.component-name’) or @livewire(‘mypackage::path.to.component.component-name’) I get always Unable to find component: [***]

Someone can try to help me solve this, I was so excited in starting to use Livewire on my package and can’t wait to see it doing his “magic”.



Update: I soved the problem 2 (that was a stupid typo) but 1 still there, if I try to use Route::livewire I get “Attribute [livewire] does not exist.”…

Anyone has an idea on why this is happening???

hey @geimsdin

maybe you are calling the wrong Route Class
Try to call the Route Facade from

use Illuminate\Support\Facades\Route;

and double-check you are calling Livewire in your package and require it’s ServiceProvider

Also try to clear the cache, sometimes it cause a problem.

livewire methods are changed in vx2

// Before
Route::livewire(’/post’, ‘show-posts’);

// After
Route::get(’/post’, \App\Http\Livewire\ShowPosts::class);

if you use livewire vx2,so u try Route::get(’/post’, \App\Http\Livewire\ShowPosts::class);