I got this error which is kind of surprising to me since I don't have it on my local environment. What I did is that I compressed the project directory and uploaded it to my cpanel file manager and then extract it. I then imported the sql file to phpmyadmin and made the credential match the ones on my production server.
When I open my site, it was working on the front page and other pages created with the Content type Basic pages. However, when I navigate to /user/login, this error appears. It also appeared on webform pages.
The website encountered an unexpected error. Please try again later. Error: Class 'Drupal\simple_sitemap\Queue\SimpleSitemapQueue' not found in Drupal\Component\DependencyInjection\Container->createService() (line 262 of core/lib/Drupal/Component/DependencyInjection/Container.php). Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.queue') (Line: 176) Drupal\Component\DependencyInjection\Container->get('simple_sitemap.queue', 1) (Line: 437) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 240) Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.queue_worker') (Line: 176) Drupal\Component\DependencyInjection\Container->get('simple_sitemap.queue_worker', 1) (Line: 437) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 240) Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.generator') (Line: 176) Drupal\Component\DependencyInjection\Container->get('simple_sitemap.generator', 1) (Line: 437) Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 240) Drupal\Component\DependencyInjection\Container->createService(Array, 'simple_sitemap.form_helper') (Line: 176) Drupal\Component\DependencyInjection\Container->get('simple_sitemap.form_helper') (Line: 198) Drupal::service('simple_sitemap.form_helper') (Line: 43) simple_sitemap_form_alter(Array, Object, 'webform_submission_contact_node_25_add_form') (Line: 539) Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'webform_submission_contact_node_25_add_form') (Line: 836) Drupal\Core\Form\FormBuilder->prepareForm('webform_submission_contact_node_25_add_form', Array, Object) (Line: 279) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 48) Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'add') (Line: 1230) Drupal\webform\Entity\Webform->getSubmissionForm() (Line: 18) Drupal\webform\WebformEntityViewBuilder->view(Object, 'default') (Line: 165) Drupal\entity_block\Plugin\Block\EntityBlock->build() (Line: 105) Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender(Object, 'section_component.build.render_array', Object) call_user_func(Array, Object, 'section_component.build.render_array', Object) (Line: 142) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'section_component.build.render_array') (Line: 90) Drupal\layout_builder\SectionComponent->toRenderArray(Array, ) (Line: 86) Drupal\layout_builder\Section->toRenderArray(Array) (Line: 317) Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildSections(Object) (Line: 276) Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple(Array) (Line: 340) Drupal\Core\Entity\EntityViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 24) Drupal\node\NodeViewBuilder->buildComponents(Array, Array, Array, 'full') (Line: 282) Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 239) Drupal\Core\Entity\EntityViewBuilder->build(Array) call_user_func_array(Array, Array) (Line: 101) Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 786) Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 377) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 201) Drupal\Core\Render\Renderer->render(Array, ) (Line: 241) Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent{closure}() (Line: 578) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 242) Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132) Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90) Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) call_user_func(Array, Object, 'kernel.view', Object) (Line: 142) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 163) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191) Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128) Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 717) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I searched and found some articles which says that clearing cache will solve the issue. I cannot login to the interface so I ran /core/rebuild.php but it doesn't solve it.
When I ran drush cr
on the command line, I got this error.
In EntityResolverManager.php line 128:
Class \Drupal\simple_sitemap\Controller\SimpleSitemapController does not exist
On my local environment I used Lando with Varbase, which is based on Drupal 9.