- Issue created by @ressa
From what I can tell, even after following all the steps in
Disable caching →
, you still need to run drush cache:rebuild
sometimes, for example if you update the *.services.yml
and the call in the code:
In mymodule.services.yml
:
services:
mymodule.example:
class: Drupal\mymodule\Example
In mymodule.module
:
echo \Drupal::service('mymodule.example')->getValue();
Do these steps:
mymodule.example
both places to mymodule.example2
The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "mymodule.example2". Did you mean this: "mymodule.example"? in Drupal\Component\DependencyInjection\Container->get() (line 157 of core/lib/Drupal/Component/DependencyInjection/Container.php).
drush cache:rebuild
, reload the page, and see that it works, and that caching wasn't completely disabled after allThis could be an issue with *.routing.yml
as well, see
#3342669-8: Reinstalling a moved module throws “ InvalidArgumentException: Class "\Drupal\example\Form\ExampleForm" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition()” →
.
Enforce disabling caching also for *.services.yml
Active
10.1 ✨