updating from 4.1.5 to 4.2.0 or 5.0.0 completely breaks the site
Problem/Motivation
Updating from Devel 4.1.5 to 4.2.0 or 5.0.0 generates a few PHP errors which completely breaks the site >> the site no longer loads on any page. Environment: Drupal > 9.4.6 PHP > 7.4 MySql > 8.0.30 Composer > 2.4.2 Drush > 10.6.2
when running any drush command (for example: drush cr), got the following errors:
PHP Fatal error: Uncaught Error: Class '\Drupal\webprofiler\DependencyInjection\TraceableContainer' not found in /path-to-site/web/core/lib/Drupal/Core/DrupalKernel.php:922 Stack trace: #0 /path-to-site/web/core/lib/Drupal/Core/DrupalKernel.php(472): Drupal\Core\DrupalKernel->initializeContainer() #1 /path-to-site/databases/web/core/includes/utility.inc(34): Drupal\Core\DrupalKernel->boot() #2 /path-to-site/vendor/drush/drush/src/Commands/core/CacheCommands.php(234): drupal_rebuild(Object(Composer\Autoload\ClassLoader), Object(Symfony\Component\HttpFoundation\Request)) #3 [internal function]: Drush\Commands\core\CacheCommands->rebuild(Array) #4 /path-to-site/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array) #5 /path-to-site/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProc in /path-to-site/web/core/lib/Drupal/Core/DrupalKernel.php on line 922 [warning] Drush command terminated abnormally.
Reverting to previous Devel version 4.1.5 solves the problem.
Proposed resolution
(Description of the proposed solution, the rationale behind it, and any workarounds)