I like being able to use the DI container in my extensions via the container hook, however I've run into the same problem a few times when switching branches that I get this error:
You have requested a non-existent service "myserviceid"
After trying drush cc all
I'd expect the container cache to be clearer, but it doesn't seem to be. My go-to option is to remove all files in the sites/default/files/civicrm/templates_c/
directory, but this seems like it should be handled by the cache clear command.
I'm aware there's an option to not use a container cache, but my question is whether the failure to clear the container cache is expected, or should it be fixed?