roots / acorn

Laravel components for WordPress plugins and themes
https://roots.io/acorn/
MIT License
827 stars 94 forks source link

WP ACORN commands not working #351

Closed natanael-aguiar closed 9 months ago

natanael-aguiar commented 9 months ago

Version

4

What did you expect to happen?

I expected that when running the wp acorn list command as described in the documentation, the list of commands available to me would be presented.

What actually happens?

When running the wp acorn list command, the following error occurs:

Fatal error: Declaration of Illuminate\Console\Application::add(Symfony\Component\Console\Command\Command $command) must be compatible with Symfony\Component\Console\Application::add(Symfony\Component\Console\Command\Command $command): ?Symfony\Component\Console\Command\Command in /var/www/html/vendor/illuminate/console/Application.php on line 211

image

Steps to reproduce

Just install Acorn with the Sage theme and try running some Acorn commands.

System info

Windows 11 with WSL 2, Docker and DDEV

Log output

[19-Feb-2024 17:52:50 UTC] PHP Fatal error: Declaration of Illuminate\Console\Application::add(Symfony\Component\Console\Command\Command $command) must be compatible with Symfony\Component\Console\Application::add(Symfony\Component\Console\Command\Command $command): ?Symfony\Component\Console\Command\Command in /var/www/html/vendor/illuminate/console/Application.php on line 211

Please confirm this isn't a support request.

Yes

retlehs commented 9 months ago

How did you install Acorn? edit: nevermind, I see the screenshot now

Are you running the wp commands from your DDEV container that has WordPress? I think you can just do ddev wp acorn?

natanael-aguiar commented 9 months ago

I installed Acorn using composer in the Bedrock root. I have already run the command ex: ddev wp acorn list. See the error presented and a screenshot:

image

natanael-aguiar commented 9 months ago

As incredible as it may seem, the error I described was related to the use of Pest https://pestphp.com/ in my Sage theme, I removed Pest, added PHPUnit and everything worked normally.

mha-baernholdt commented 8 months ago

As incredible as it may seem, the error I described was related to the use of Pest https://pestphp.com/ in my Sage theme, I removed Pest, added PHPUnit and everything worked normally.

@natanael-aguiar can you elaborate what you did to fix this, i have the same issue also using the sage them, but i don't see where pest is used.

TimAtTeamlemke commented 7 months ago

Same error here after configuring the sage theme to use scss instead of css and replacing tailwind with bootstrap and installing blade icons. After that "$ wp acorn vendor:publish --tag=blade-icons" could no longer be executed. Blank installation. When I removed all the packages and dependencies, I was able to execute wp acorn commands again.

Log1x commented 7 months ago

After that "$ wp acorn vendor:publish --tag=blade-icons" could no longer be executed. Blank installation.

Make sure Blade Icons and Acorn are installed in the same composer.json - if not, Laravel packages will install a conflicting version of Laravel dependencies.