Unable to get Sage 10 to work at all

I’ve used Sage 9 for years and thought I’d check out Sage 10 since it’s been out for a while now, but it’s been much more of a headache than I’d imagined.

I’m running
Node v19.7.0
Composer 2.5.4
PHP 8.1.9
Local by Flywheel for local web server (version 6.6.1) with Apache and MySQL

I’m just trying to get things up and running at all but it’s not working.
I ran:
composer create-project roots/sage my-new-theme
composer require roots/acorn
yarn
yarn build

Everything installs and compiles correctly, and I get no errors, but when I try to activate the theme, I just get this error message:

Fatal error: Declaration of Illuminate\Container\Container::get(string $id) must be compatible with Psr\Container\ContainerInterface::get($id) in /my-local-theme-folder/vendor/illuminate/container/Container.php on line 714

I’ve tried everything I can find on forums but nothing seems to help. Anyone have any ideas?

This issue looks very similar to this one:

That’s definitely the same error message but the solution in that thread is to downgrade psr/container to version 1.0.0 which doesn’t work. If I try that I get dependency errors:
Problem 1

    • illuminate/container[v9.0.0-beta.1, …, 9.x-dev] require psr/container ^1.1.1|^2.0.1 → found psr/container[dev-master, 1.1.1, 1.1.2, 1.1.x-dev, 1.x-dev, 2.0.1, 2.0.2, 2.0.x-dev (alias of dev-master)] but it conflicts with your root composer.json require (1.0.0).*
    • roots/acorn v3.1.0 requires illuminate/container ^9.47 → satisfiable by illuminate/container[v9.47.0, …, 9.x-dev].*
    • Root composer.json requires roots/acorn ^3.1 → satisfiable by roots/acorn[v3.1.0].*

If this version is really the problem, it seems strange that Sage would ship with a glaring issue like this. Has anyone been able to successfully resolve this issue?

What’s your composer.json?

Try dropping your PHP version to 8.0 and re-run composer upgrade

it seems strange that Sage would ship with a glaring issue like this.

fwiw it’s not a glaring issue, it has to do with your local environment.

Are you running composer commands from Local’s web container (via the Open site shell button) or on your host machine? You’re going to have a hard time getting things to work correctly if you’re running the composer commands from your host machine and not from Local’s shell.

Do you have the basic composer.json? Or did you add plugins too?

I had this problem recently. Version conflict between acorn and a plugin. For example to make both work, I forced psr/log to 2.*

If it can help …

1 Like

It turns out the conflict was with iThemes Security Pro which is part of our standard install package. Disabling that fixed the issue and will at least let me troubleshoot from here. Thank you! I never would’ve guessed that a common plugin (which worked fine with Sage 9) would cause issues. I appreciate the assist.