Skip to content

Livewire 4 MFC/view-based problem #557

@MohammaddReza

Description

@MohammaddReza

I’m seeing a problem when trying to use a "Livewire 4 Multi-File Component (MFC)" as a modal target with wire-elements/modal.

When I dispatch openModal with the component alias (for example front.home.modal), the package throws:

TypeError: LivewireUI\Modal\Modal::resolveComponentClass(): Return value must be of type string, null returned

From debugging, it looks like the modal package tries to resolve the component alias to a PHP class via resolveComponentClass(), but for a Livewire 4 MFC (view-based/anonymous component), the resolver returns null, which causes the TypeError.

My MFC component is created using the Livewire 4 MFC structure (folder-based component with modal.php + modal.blade.php), and the alias is dispatched correctly. This works like a normal Livewire component setup, but fails specifically when used through wire-elements/modal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions