I'm started drupal project (core 9.5.2) installing modules manually (it is not good, i know). After the website is deployed in production, I made changes for configuring composer and all worked well.
As new versions of modules come out, I install them through composer. I use composer require (and the module is installed in /modules/contrib) and then I remove the module folder in /modules, clear the cache and everything works fine. I did this with several modules, such as: ctools, icme, panels, slick, symfony_mailer and others. However, when trying to perform this procedure with the webform, things do not go well (error below). I know that correct way would be to uninstall the module and reinstall it with composer, however, I would lose all the forms created, and all submissions already made. Is there a workaround for this problem?
The website encountered an unexpected error. Please try again later.
Error: Class "Drupal\webform_ui\PathProcessor\WebformUiPathProcessor" not found in Drupal\Component\DependencyInjection\Container->createService() (line 259 of core/lib/Drupal/Component/DependencyInjection/Container.php).
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 434)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() (Line: 273)
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 434)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() (Line: 237)
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 434)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() (Line: 237)
Drupal\Component\DependencyInjection\Container->createService() (Line: 177)
Drupal\Component\DependencyInjection\Container->get() (Line: 136)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 145)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 23)
Stack\StackedHttpKernel->handle() (Line: 713)
Drupal\Core\DrupalKernel->handle() (Line: 19)
I tried clear cache with "drush cc" but have same error.
cache_*
tables exist in the DB), backup your DB then truncate those tables (i.e. empty their contents, keep the table). Then try refreshing your page. If your cache is on Redis (I dunno if shared hosting uses Redis but who knows?), flush Redis and refresh the page.