When activating sage theme, I got an error about Illuminate\Support\Collection

I got trellis and bedrock installed which work perfectly. I did everything from the documentation of sage 9, trellis and bedrock. But, when I start with “yarn start run”, my localhost:3000 is on browsersync but it activate automatically another theme than sage, even thought I have only sage in my app/themes/. Now, when I go to wp-admin and activate sage, I got this wonderful orange error :

Fatal error: Uncaught Error: Class ‘Illuminate\Support\Collection’ not found in /srv/www/example.com/current/web/app/themes/sage/vendor/illuminate/support/helpers.php on line 379

I installed my sage 9 from composer, yarn seems to worked, so… I don’t know, really. Did I miss something or what can I do to get sage theme working?

Thanks everyone

This is normal. Sage doesn’t automatically activate itself, and Trellis and Bedrock don’t assume you want to use a Sage theme (and wouldn’t be able to guess which theme you wanted to use anyway). Bedrock starts with the same defaults as vanilla WordPress including the default theme.

Did you run composer install in your Sage directory?

What environment are you developing in?

Your reference to example.com makes me think you didn’t configure Trellis completely.

running composer install do nothing, it gives me this message : Nothing to install or update.
I am currently working on my local environnement.
For this time, I did not configured Trellis completely. However, I installed everything and configured everything twice before this one ; the result is always the same when I activate sage theme. Trellis is working well, the issue is with the sage theme not able to recognize a certain class even if I have followed perfectly the document for sage. Even google can’t help me on this. :confused:

Perhaps this image may come in help.

Are you on a Mac or a PC?

macOS Sierra 10.12.16

Even if I try to use wp-cli on my server (by doing vagrant ssh on the folder trellis), I get the same error, thus, I cannot even change back to a default theme.

Try updating to Composer 1.6.2 using composer self-update. This fixed the problem for me.

1 Like

Had a slightly different error but hope this helps someone out.

PHP Fatal error: Interface 'Illuminate\Contracts\Support\Arrayable' not found in /srv/woopie/web/app/themes/prime/vendor/illuminate/support/Collection.php on line 42

I had to remove the vendor folder inside the theme and clean composer using composer clear-cache and composer install again.