Open montchr opened 1 year ago
I will also add my comment from https://discourse.roots.io/t/tinkerwell-with-sage-10-bedrock/24821/6 here for anyone with the same problem.
For me, this was a problem with Tinkerwell and when running PHP unit tests using Pest.
When running pest
tests, instead of running the tests, acorn is taking over, and it will show the available commands.
A temporary, simple solution in my case was:
if( isset( $_SERVER['argv'] ) && ! in_array( 'acorn', $_SERVER['argv'] ) ){
putenv( 'APP_RUNNING_IN_CONSOLE=false' );
}
I do not use bedrock, and Acorn is loaded through a mu-plugin. I’ve added the snippet above just before loading vendor/autoload.php
Since I posted this on discourse.roots.io, I have had no problems with this approach, even if this looks a bit hacky.
Terms
Description
What's wrong?
Tinkerwell fails to run with the following error:
It looks like the
cli
service provider expected bySymfony\\Component\\Console\\Application
is unavailable.Related to #49, but not the same issue.
What have you tried?
I've tried not using Tinkerwell, which works.
Not sure how to proceed.
What insights have you gained?
See the Discourse thread for more context.
Possible solutions
???
See https://github.com/tinkerwellapp/drivers/blob/master/src/Drivers/LaravelTinkerwellDriver.php for an example of how Tinkerwell would load a Laravel application.
Also see https://github.com/tinkerwellapp/drivers/blob/master/src/Drivers/SymfonyTinkerwellDriver.php, though it doesn't provide much more insight.
Temporary workarounds
Others in the Discourse thread have reported that commenting out the
\Roots\Acorn\Bootloader::bootConsole
method resolves the issue. I haven't tried this, because I would prefer a permanent fix instead of maintaining commenting out code in Acorn. So I just can't use Tinkerwell for the time being because of the conflict.Steps To Reproduce
\Roots\app
)home_url()
Expected Behavior
Tinkerwell should work. The console kernel should have all the necessary dependencies.
Actual Behavior
Tinkerwell fails due to missing app services.
Relevant Log Output
Versions
v3.1.0