Acorn component - Unable to locate a class or view for 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.5.1 with Laravel/Acorn 3.1.0 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 LinkClickable
  2. The component class (LinkClickable.php) has been generated in the app/View/Components directory with the correct namespace: namespace App\View\Components;*
  3. The corresponding Blade view file is located at resources/views/components/link-clickable.blade.php.
  4. I’ve cleared the view cache using:
    wp acorn view:clear
  5. In my Blade template, I’m including the component like this:
    <x-LinkClickable link="{{ get_author_posts_url(get_current_user_id()) }}" class="nav-link" target='_blank'>{{ __('my reviews') }}</x-LinkClickable>

I’m using vagrant & ansible/trellis for local server & provisioning to remote server.

Locally all works fine.
When I do a deploy in my remote machine this error appears:

**Fatal error**: Uncaught Exception: Unable to locate a class or view for component [LinkClickable]. (View: /srv/www/my-site/releases/1680186655/web/app/themes/mp_che_test/resources/views/partials/archive-header.blade.php)

in **/srv/www/my-site/releases/1680186655/vendor/illuminate/view/Compilers/ComponentTagCompiler.php** on line **311**

Call stack:

1. `Illuminate\V\E\CompilerEngine::handleViewException()`


2. `Illuminate\V\E\PhpEngine::evaluatePath()`


3. `Illuminate\V\E\CompilerEngine::get()`


4. `Illuminate\View\View::getContents()`


5. `Illuminate\View\View::renderContents()`


6. `Illuminate\View\View::render()`


7. `include()`


8. `require_once()`


9. `require()`


I created 5 components with command cli acorn but in production and staging server they don’t work.
So I try to edit my composer.json file adding this:

  "post-autoload-dump": [
    "wp acorn cache:clear",
    "wp acorn optimize:clear",
    "wp acorn view:clear",
    "wp acorn config:clear"
  "extra": {
    "acorn": {
      "providers": [
      "components": [
      "composers": [

but nothing change.

If I look into /srv/www/my_site/current/vendor/composer/autoload_classmap.php components are present.

I do not understand why in local all works fine, but in production server none.

when I create a component from wp acorn cli it create a class that use
use Illuminate\View\Component;

instead of
use Roots\Acorn\View\Component;

I try to use this component class… but nothing change in production…

Maybe this
Wp acorn cli create

    public function render()
        return view('components.button');

I need

    public function render()
        return $this->view('components.button');

Nothing… please help me :\

does <x-link-clickable ... /> work?



For some reason I thought that when I’m deploying the project … running composer install it should also do composer dump-autoload…

I added immediately after the composer install task … the composer dump-autoload task

And it all seems to work!