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?
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).*
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?
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.
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.