Sage 10 - fresh install gives fatal error

I’ve not used sage since v9. On the quest to make a new version of an existing theme into a super light, low carbon, website theme, I wanted to come back to sage and test it a little with the CSS frameworks available - and see how that stacks up against some other possible starting points. I loved how easy it was with sage9 to contextualise theme parts and I’m sure that would also help me make the theme lighter.

I’ve managed to install the theme ok but when I activate it I get the following error:

( ! ) Fatal error: Declaration of Illuminate\Foundation\Application::register($provider, $force = false) must be compatible with Illuminate\Contracts\Foundation\Application::register($provider, $options = [], $force = false) in /Users/**username**/Local Sites/theme-test-sage/app/public/wp-content/plugins/acorn/src/Illuminate/Foundation/Application.php on line 669
Call Stack
#	Time	Memory	Function	Location
1	0.0043	366600	{main}( )	.../index.php:0
2	0.0043	366912	require( '/Users/**username**/Local Sites/theme-test-sage/app/public/wp-blog-header.php )	.../index.php:17
3	0.0043	367552	require_once( '/Users/**username**/Local Sites/theme-test-sage/app/public/wp-load.php )	.../wp-blog-header.php:13
4	0.0043	368088	require_once( '/Users/**username**/Local Sites/theme-test-sage/app/public/wp-config.php )	.../wp-load.php:50
5	0.0044	376888	require_once( '/Users/**username**/Local Sites/theme-test-sage/app/public/wp-settings.php )	.../wp-config.php:93
6	0.4251	21987416	do_action( $hook_name = 'after_setup_theme' )	.../wp-settings.php:595
7	0.4251	21987792	WP_Hook->do_action( $args = [0 => ''] )	.../plugin.php:517
8	0.4251	21987792	WP_Hook->apply_filters( $value = '', $args = [0 => ''] )	.../class-wp-hook.php:332
9	0.4251	21988952	Roots\bootloader( $callback = '' )	.../class-wp-hook.php:308
10	0.4259	21989328	Roots\Acorn\Bootloader::getInstance( )	.../helpers.php:50
11	0.4259	21989504	Roots\Acorn\Bootloader->__construct( $hooks = ???, $appClassName = ??? )	.../Bootloader.php:88
12	0.4259	21989504	class_implements( $object_or_class = 'Roots\\Acorn\\Application', $autoload = TRUE )	.../Bootloader.php:101
13	0.4259	21989632	Composer\Autoload\ClassLoader->loadClass( $class = 'Roots\\Acorn\\Application' )	.../Bootloader.php:101
14	0.4259	21989632	Composer\Autoload\includeFile( $file = '/Users/**username**/Local Sites/theme-test-sage/app/public/wp-content/plugins/acorn/vendor/composer/../../src/Roots/Acorn/Application.php' )	.../ClassLoader.php:428
15	0.4260	21991888	include( '/Users/**username**/Local Sites/theme-test-sage/app/public/wp-content/plugins/acorn/src/Roots/Acorn/Application.php )	.../ClassLoader.php:571
16	0.4261	21991888	Composer\Autoload\ClassLoader->loadClass( $class = 'Illuminate\\Foundation\\Application' )	.../Application.php:24
17	0.4261	21991888	Composer\Autoload\includeFile( $file = '/Users/**username**/Local Sites/theme-test-sage/app/public/wp-content/plugins/acorn/vendor/composer/../../src/Illuminate/Foundation/Application.php' )	.../ClassLoader.php:428
18	0.4262	22002328	include( '/Users/**username**/Local Sites/theme-test-sage/app/public/wp-content/plugins/acorn/src/Illuminate/Foundation/Application.php )	.../ClassLoader.php:571

Not sure whether this is relevant:

In the docs the acorn install seems to be dependent mainly on having bedrock - which I’ve chosen not to have on this install. Makes me wonder if bedrock is now a prerequisite for Sage theme?

I chose the option of using the plugin version of Acorn which is installed and activated on the test site as this is the only one which seems to be possible without bedrock.

Can anyone help with this error? Need to be able to get a version up and running to see if it’s an option for my next project.

This appears to be the same issue as this one:

Hello, thanks for you reply.

This isn’t the same issue. I do have the Acorn plugin activated - this error message is occurring with Acorn plugin installed and active.

What kind of hosting environment is this on?
Is acorn activated?
Is acorn installed in bedrock or in the theme?

I have used the Acorn plugin installed and activated in the main plugins folder. This is not set up as Bedrock.

I’m using LocalWP, PHP 8.0.16, Ngix.

Im not sure what you mean about installing Acorn in the theme, can’t see any step around this in the installation documentation Installation | Sage Docs | Roots

If not installing it as a plugin, you can install acorn with composer. Actually it’s recommended to install it with composer (bedrock or sage), and that’s what is officially supported. So, it kind of is a requirement, kind of not. I have had it working fine through a plugin though.

Have you made any edits to sage?
Were things working at any point and now it is not or have you not gotten things working yet?

This illuminate error can show up for lots of reasons.

Try these things:

1 Like

@meemal My apologies about the state of the installation docs, they need some improvements. I’m going to update them this week to be less confusing.

Can you try removing Acorn as a plugin and instead run composer require roots/acorn from your theme directory?

While we prefer folks to use Bedrock (or something like it) and install Acorn as a dependency at the top level of your site, it’s still possible and supported to install Acorn from within the Sage theme

AH, so the way it was worded in the installation help for Acorn made me think it only worked with Bedrock. Thanks for the clarification @erit and @ben. Great the documentation is in progress! Is there an ETA on the book also?

I have removed the Acorn plugin.

So now in my theme folder have tried to install it with composer but again get a message about

naomispirit@Naomis-MacBook-Pro dbd-v3 % composer require roots/acorn
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^2.1 for roots/acorn
./composer.json has been updated
Running composer update roots/acorn
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - roots/acorn[v2.1.0, ..., v2.1.2] require illuminate/config ^8.70 -> found illuminate/config[v8.70.0, ..., v8.83.27] but the package is fixed to v5.6.39 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires roots/acorn ^2.1 -> satisfiable by roots/acorn[v2.1.0, v2.1.1, v2.1.2].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

So took the advice to try with the install dependencies flag and get some more issues

naomispirit@Naomis-MacBook-Pro dbd-v3 % composer require roots/acorn -w    
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^2.1 for roots/acorn
./composer.json has been updated
Running composer update roots/acorn --with-dependencies
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Dependency "illuminate/support" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies (-W) to include root dependencies.
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - roots/acorn[v2.1.0, ..., v2.1.2] require illuminate/support ^8.70 -> found illuminate/support[v8.70.0, ..., v8.83.27] but it conflicts with your root composer.json require (5.6.*).
    - Root composer.json requires roots/acorn ^2.1 -> satisfiable by roots/acorn[v2.1.0, v2.1.1, v2.1.2].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Can you try a fresh WP install with no other themes? It looks like you’ve got conflicts from somewhere else in your setup

Hello, tried a fresh install with no other theme and you’re right it worked. So then on my existing example I removed the sage 9 theme example I had and now the site loads!

I thought that each theme was an isolated environment - I didn’t realise another theme at the same level could interfere.

I’ve used PHP 8.0 and getting one error still

Deprecated: Method ReflectionParameter::getClass() is deprecated in /Users/naomispirit/Local Sites/dunnet-bay-distillers/app/public/wp-content/themes/dbd-v3/vendor/illuminate/container/Container.php on line *826*

Any ideas?

1 Like

That error sounds like an outdated illuminate/container package. What roots/acorn version and illuminate/container version do you have in your lock file?

In the lockfile there is this information about illuminate & Acorn

//composer.lock

    "name": "illuminate/config",
            "version": "v5.6.39",

//yarn.lock

acorn-dynamic-import@^2.0.0:
  version "2.0.2"
  resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4"
  integrity sha512-GKp5tQ8h0KMPWIYGRHHXI1s5tUpZixZ3IHF2jAu42wSCf6In/G873s6/y4DdKdhWvzhu1T6mE1JgvnhAKqyYYQ==
  dependencies:
    acorn "^4.0.3"

acorn-globals@^1.0.4:
  version "1.0.9"
  resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-1.0.9.tgz#55bb5e98691507b74579d0513413217c380c54cf"
  integrity sha512-j3/4pkfih8W4NK22gxVSXcEonTpAHOHh0hu5BoZrKcOsW/4oBPxTi4Yk3SAj+FhC1f3+bRTkXdm4019gw1vg9g==
  dependencies:
    acorn "^2.1.0"

acorn-import-assertions@^1.7.6:
  version "1.8.0"
  resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9"
  integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==

acorn-jsx@^3.0.0, acorn-jsx@^3.0.1:
  version "3.0.1"
  resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b"
  integrity sha512-AU7pnZkguthwBjKgCg6998ByQNIMjbuDQZ8bb78QAFZwPfmKia8AIzgY/gWgqCjnht8JLdXmB4YxA0KaV60ncQ==
  dependencies:
    acorn "^3.0.4"

acorn-object-spread@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/acorn-object-spread/-/acorn-object-spread-1.0.0.tgz#48ead0f4a8eb16995a17a0db9ffc6acaada4ba68"
  integrity sha512-XLGUSlVB4GeniUbk97r+NxLvcQDYNddFBl1WHSvMr/4v5lnNPWHzwHLdXrlBnusvZ0zq2lkjDm7fPEgJpjb4dg==
  dependencies:
    acorn "^3.1.0"

acorn@^2.1.0, acorn@^2.4.0:
  version "2.7.0"
  resolved "https://registry.yarnpkg.com/acorn/-/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7"
  integrity sha512-pXK8ez/pVjqFdAgBkF1YPVRacuLQ9EXBKaKWaeh58WNfMkCmZhOZzu+NtKSPD5PHmCCHheQ5cD29qM1K4QTxIg==

acorn@^3.0.4, acorn@^3.1.0, acorn@^3.3.0:
  version "3.3.0"
  resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
  integrity sha512-OLUyIIZ7mF5oaAUT1w0TFqQS81q3saT46x8t7ukpPjMNk+nbs4ZHhs7ToV8EWnLYLepjETXd4XaCE4uxkMeqUw==

acorn@^4.0.3:
  version "4.0.13"
  resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787"
  integrity sha512-fu2ygVGuMmlzG8ZeRJ0bvR41nsAkxxhbyk8bZ1SS521Z7vmgJFTQQlfz/Mp/nJexGBz+v8sC9bM6+lNgskt4Ug==

acorn@^5.0.0, acorn@^5.5.0:
  version "5.7.4"
  resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e"
  integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==

acorn@^8.5.0, acorn@^8.7.1:
  version "8.8.2"
  resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a"
  integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==