Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Target class [blade.compiler] does not exist" after upgrading to Acorn v3 #77

Closed
mrmadhat opened this issue Jan 31, 2023 · 3 comments
Closed

Comments

@mrmadhat
Copy link

I'm having an issue using sage-directives after upgrading to Acorn v3. I can use directives within blade files as per usual and everything works correctly when viewing the site but I can no longert use wp cli.

  1. Upgrade Acorn from version ^2.1 to version 3.0
  2. Run wp acorn
  3. The cli doesn't return any output and the following error is added to the debug.log:
Next Illuminate\Contracts\Container\BindingResolutionException: Target class [blade.compiler] does not exist. in /app/vendor/illuminate/container/Container.php:891
Stack trace:
#0 /app/vendor/illuminate/container/Container.php(770): Illuminate\Container\Container->build('blade.compiler')
#1 /app/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(860): Illuminate\Container\Container->resolve('blade.compiler', Array, true)
#2 /app/vendor/illuminate/container/Container.php(706): Illuminate\Foundation\Application->resolve('blade.compiler', Array)
#3 /app/vendor/roots/acorn/src/Illuminate/Foundation/Application.php(845): Illuminate\Container\Container->make('blade.compiler', Array)
#4 /app/vendor/roots/acorn/src/Illuminate/Foundation/helpers.php(120): Illuminate\Foundation\Application->make('blade.compiler', Array)
#5 /app/vendor/roots/acorn/src/Roots/helpers.php(108): app('blade.compiler')
#6 /app/web/app/themes/theme/vendor/log1x/sage-directives/src/Directives.php(90): Roots\app('blade.compiler')
#7 /app/web/app/themes/theme/vendor/log1x/sage-directives/src/Directives.php(35): Log1x\SageDirectives\Directives->blade()
#8 /app/web/wp/wp-includes/class-wp-hook.php(307): Log1x\SageDirectives\Directives->Log1x\SageDirectives\{closure}('')
#9 /app/web/wp/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
#10 /app/web/wp/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
#11 /app/web/wp/wp-settings.php(576): do_action('after_setup_the...')
#12 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1336): require('/app/web/wp/wp-...')
#13 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1254): WP_CLI\Runner->load_wordpress()
#14 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#15 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(78): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#16 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#17 phar:///usr/local/bin/wp/php/boot-phar.php(11): include('phar:///usr/loc...')
#18 /usr/local/bin/wp(4): include('phar:///usr/loc...')
#19 {main}
  thrown in /app/vendor/illuminate/container/Container.php on line 891
@iniznet
Copy link

iniznet commented Feb 1, 2023

I wonder if there's any reason for sage-directives to be included in wp cli. For now, I excluded the library from wp-cli by checking if blade.compiler exists too.

if (function_exists('Roots\app') && \Roots\app()->bound('blade.compiler')) {
    return \Roots\app('blade.compiler');
}

@ryanemitchell
Copy link

I can confirm the same behavior as @mrmadhat in a clean install of Sage 10 with Acorn v3.0 and that @iniznet's edit to sage-directives/src/Directives.php allows wp-cli to function again.

Nice temp fix while things get sorted. 🤘🏻

@retlehs
Copy link

retlehs commented Feb 3, 2023

Fixed with Acorn v3.0.1

https://github.com/roots/acorn/releases/tag/v3.0.1

@Log1x Log1x closed this as completed Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants