Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bogdy's avatar
Level 10

Laravel Livewire - "Unable to find component: [navigation-menu]" Error Despite Component Existing

Hello everyone,

I'm experiencing an issue with Laravel Livewire. I keep getting the error "Unable to find component: [navigation-menu]" when navigating to my dashboard. This is puzzling because the component does actually exist. @livewire('navigation-menu')

I've run the commands php artisan view:clear and php artisan cache:clear to clear any cached versions, but to no avail.

The error seems to highlight this line: ` $__html = app('livewire')->mount($__name, $__params, 'some_string_here', $__slots ?? [], get_defined_vars());

`

If anyone has encountered a similar issue or has any ideas on what I could try next, your input would be greatly appreciated.

0 likes
9 replies
jaseofspades88's avatar
Level 51

If you've changed the namespace from the default one, if you add it to a service provider (custom or not) within boot then it will register the component.

    public function boot(): void
    {
        Livewire::component('navigation-menu', NavigationMenu::class);
    }

...and don't forget to import Livewire and NavigationMenu too

2 likes
bogdy's avatar
Level 10

@jaseofspades88 it works with boot register I can't figure out what I've done. It's a fresh install of Laravel with Livewire

jaseofspades88's avatar

If it isn't in the default namespace then you'll need to register the components.

shomari's avatar

@jaseofspades88 This is exactly what I needed. However, is there any way to configure Livewire to automatically discover components? I broke my application into modules (app/Modules) and for each module, I recreated a service provider (e.g. app/Modules/Registration/RegistrationServiceProvider.php). In the boot method of that file, I call:

  $this->loadRoutesFrom(__DIR__ . 'routes.php');
  $this->loadViewsFrom(__DIR__ . '/views', 'registration');

Is there something similar for Livewire?

jaseofspades88's avatar

There is a way yes, @shomari - use the default structure that Livewire expects, otherwise it can't 'automatically' resolve the component from anywhere. This is why you need to register it accordingly.

Glad I could help!

dasenlin's avatar

update App\Providers\JetstreamServiceProvider.php

public function register(): void
    {
        $this->callAfterResolving(BladeCompiler::class, function () {
            if (config('jetstream.stack') === 'livewire' && class_exists(Livewire::class)) {
                Livewire::component('navigation-menu', NavigationMenu::class);
                Livewire::component('profile.update-profile-information-form', UpdateProfileInformationForm::class);
                Livewire::component('profile.update-password-form', UpdatePasswordForm::class);
                Livewire::component('profile.two-factor-authentication-form', TwoFactorAuthenticationForm::class);
                Livewire::component('profile.logout-other-browser-sessions-form', LogoutOtherBrowserSessionsForm::class);
                Livewire::component('profile.delete-user-form', DeleteUserForm::class);

                if (Features::hasApiFeatures()) {
                    Livewire::component('api.api-token-manager', ApiTokenManager::class);
                }

                if (Features::hasTeamFeatures()) {
                    Livewire::component('teams.create-team-form', CreateTeamForm::class);
                    Livewire::component('teams.update-team-name-form', UpdateTeamNameForm::class);
                    Livewire::component('teams.team-member-manager', TeamMemberManager::class);
                    Livewire::component('teams.delete-team-form', DeleteTeamForm::class);
                }
            }
        });
    }
bogdy's avatar
Level 10

@joserick yes You are right. I have installed a fresh Laravel with Jetstream again and I have the same problem.

Please or to participate in this conversation.