Class not found on production server

Hi!

I’ve been testing various deployments and now I’m just trying to upload my sage theme to the server via sftp/ssh. But once I activate the theme I’m getting the following error:

PHP Fatal error: Uncaught ReflectionException: Class App\\Controllers\\App does not exist in /var/www/html/wp-content/themes/dermotienda/vendor/soberwp/controller/src/Loader.php:74\nStack trace:\n#0 /var/www/html/wp-content/themes/dermotienda/vendor/soberwp/controller/src/Loader.php(74): ReflectionClass->__construct('App\\\\Controllers...')\n#1 /var/www/html/wp-content/themes/dermotienda/vendor/soberwp/controller/src/Loader.php(35): Sober\\Controller\\Loader->setPath()\n#2 /var/www/html/wp-content/themes/dermotienda/vendor/soberwp/controller/controller.php(22): Sober\\Controller\\Loader->__construct(Object(Brain\\Hierarchy\\Hierarchy))\n#3 /var/www/html/wp-includes/class-wp-hook.php(286): Sober\\Controller\\loader('')\n#4 /var/www/html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)\n#5 /var/www/html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)\n#6 /var/www/html/wp-settings.php(450): do_action('init')\n#7 /var/www/html/wp-config.php(89): require_once('/var/www/html/w...')\n#8 /var/www/html/wp-load.php(37): require in /var/www/html/wp-content/themes/dermotienda/vendor/soberwp/controller/src/Loader.php on line 74, referer: http://206.189.162.220/wp-admin/themes.php

I’ve checked previous threads but I really don’t understand the solutions stated. I know it must be a namespacing issue but still can get to the actual workaround.

Notice that I uploaded the theme’s vendor directory too. Would reinstalling the composer packages from the server solve it?

Thanks!

update: i reinstalled composer packages and still the same.

Searching for your exact error on this forum would bring you to:

Yep, kind fo solved it with the help of that post. At the end I had to rename the controllers folder to Controller and capitalize all the controllers (i.e. TemplatePage.php) to make it work.