Fatal error: Call to undefined method Illuminate\Container\Container::setBasePath() in acorn/src/Roots/Acorn/Bootloader.php:205

I’m trying to convert a site built with Bedrock/Sage/Acorn by another agency to our own standard which doesn’t use Bedrock. I copied the theme into our setup and managed to get Acorn installed via composer as a plugin, using a custom Composer repository. However, any attempt to load the site ends up with an issue with Illuminate\Container\Container::setBasePath() not being found. It’s as if the vendor directory is incomplete or has the wrong packages installed for the download release of Acorn. We are running on PHP 8.0 and installing version 2.1.1 for PHP 8.0.

I’m going to take it that since I have received literally no response that this says that Roots.io has no intention on supporting Acorn with anything but Bedrock?

Acorn has no dependency on Bedrock. You will have to provide a larger stack trace or an example repo for us to help debug this. Is the theme activated? Have you tried a fresh install of Sage 10 + Acorn?

So I have already installed a fresh copy of the Acorn plugin from the releases. This is done via Composer directly from GitHub(https://github.com/roots/acorn/releases/download/v2.1.2/acorn-v2.1.2-php-8.0.zip). Additionally, I can’t reinstall Sage as the theme has been provided by another vendor as a finished theme.

The full stack error is this:

Fatal error: Uncaught Error: Call to undefined method Illuminate\Container\Container::setBasePath() in /var/www/html/web/wp-content/plugins/acorn/src/Roots/Acorn/Bootloader.php:205 Stack trace: #0 /var/www/html/web/wp-content/plugins/acorn/src/Roots/Acorn/Bootloader.php(181): Roots\Acorn\Bootloader->app() #1 /var/www/html/web/wp/wp-includes/class-wp-hook.php(308): Roots\Acorn\Bootloader->__invoke('') #2 /var/www/html/web/wp/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #3 /var/www/html/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /var/www/html/web/wp/wp-settings.php(595): do_action('after_setup_the...') #5 /var/www/html/web/wp-config.php(249): require_once('/var/www/html/w...') #6 /var/www/html/web/wp/wp-load.php(55): require_once('/var/www/html/w...') #7 /var/www/html/web/wp/wp-admin/admin.php(34): require_once('/var/www/html/w...') #8 /var/www/html/web/wp/wp-admin/themes.php(10): require_once('/var/www/html/w...') #9 {main} thrown in /var/www/html/web/wp-content/plugins/acorn/src/Roots/Acorn/Bootloader.php on line 205

I think I mis-typed the initial issue as we are running version 2.1.2 of Acorn as a plugin.

I’ve attempted to use the straight Composer package instead of the plugin zip package and I’m receiving the same error.

Fatal error: Uncaught Error: Call to undefined method Illuminate\Container\Container::setBasePath() in /var/www/html/web/wp-content/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php:205 Stack trace: #0 /var/www/html/web/wp-content/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php(181): Roots\Acorn\Bootloader->app() #1 /var/www/html/web/wp/wp-includes/class-wp-hook.php(308): Roots\Acorn\Bootloader->__invoke('') #2 /var/www/html/web/wp/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #3 /var/www/html/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /var/www/html/web/wp/wp-settings.php(595): do_action('after_setup_the...') #5 /var/www/html/web/wp-config.php(385): require_once('/var/www/html/w...') #6 /var/www/html/web/wp/wp-load.php(55): require_once('/var/www/html/w...') #7 /var/www/html/web/wp/wp-login.php(12): require('/var/www/html/w...') #8 {main} thrown in /var/www/html/web/wp-content/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php on line 205

After installing a new Sage 10 theme next to the existing theme I can see what looks like a ton of Namespaces and additional classes the vendor included in the theme functions.php file which included use Illuminate\Container\Container and it seems like this is part of what’s causing the problem with the initialization of Acorn, as the $app object is ending up being an instance of the Illuminate\Container\Container class.

With the information provided there’s no way for us to really help you– especially if the theme is customized to the point where they are initializing their own container.