Unable to locate a class or view for custom Acorn component

Hello everyone,

I’m facing an issue with Sage and Acorn where I’m unable to locate a class or view for a custom component I’ve created. I’m using Sage 10 with Laravel/Acorn and have followed the instructions to create a new component.

Here’s what I’ve done so far:

  1. Created the component using the Acorn CLI command:
    wp acorn make:component Block/BrandList

  2. The component class (BrandList.php) has been generated in the app/View/Components/Block directory with the correct namespace:
    namespace App\View\Components\Block;

  3. The corresponding Blade view file is located at resources/views/components/block/brand-list.blade.php.

  4. I’ve cleared the view cache using:
    wp acorn view:clear

  5. In my Blade template, I’m including the component with:

Despite following these steps, I still get the error:
Unable to locate a class or view for component [block-brand-list].

I’ve double-checked the file paths, namespaces, and tried clearing the cache, but I can’t seem to resolve the issue.

Any help or guidance on what I might be missing would be greatly appreciated. Thanks in advance!

It looks like this got left out of your post.

<x-block.brand-list /> should work though.

1 Like

Thanks, it worked!

I was just trying to tidy up my components by putting them in folders