Can't bake my project in ubuntu


I created a website long time ago and saved it in my git repository. And recently I wanted to restore the website in a fresh ubuntu 18.04 server. The version of UserFrosting framework is 4.0 or 4.1 I guess.

So, in a fresh ubuntu server with LAMP, I pull the code from my git repo and I ran

  1. composer install
  • worked fine
  1. php bakery bake
  • it throws an error
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to UserFrosting\System\ServicesProvider::register() must be an instance of Interop\Container\ContainerInterface, instance of Slim\Container given, called in /var/www/mingle/app/system/UserFrosting.php on line 132 and defined in /var/www/mingle/app/system/ServicesProvider.php:30
Stack trace:
#0 /var/www/mingle/app/system/UserFrosting.php(132): UserFrosting\System\ServicesProvider->register(Object(Slim\Container))
#1 /var/www/mingle/app/system/Bakery/Bakery.php(49): UserFrosting\System\UserFrosting->setupSprinkles(false)
#2 /var/www/mingle/bakery(33): UserFrosting\System\Bakery\Bakery->__construct()
#3 {main}
  thrown in /var/www/mingle/app/system/ServicesProvider.php on line 30

I am not sure why I am getting this error. How can I fix it?

Most probably caused by the same root-cause as this issue:

In any case, I would always suggest you upgrade to UF 4.3.3 or later.

Even though my website was built in older version, it should also work in the server right? I don’t understand why I have to upgrade UF. Is it because of compatibility issue with 3rd party library such as composer and slim?

composer isn’t a library, it’s a package manager which you used to update all your packages. Apparently the Slim developers introduced a breaking change with a recent release. To fix this, the UserFrosting developers had to publish a new release.

Please read this section in the (excellent) UserFrosting documentation:

Then I can just install older version of slim, can’t I?

Probably, you’ll have to figure out which exact version you need to roll back to though.

Slim version could technically be locked in your sprinkle :