TYPO3 v10: Cannot autowire service PageRepository

raw

README.rst

I got an error when updating to TYPO3 v10 and dependency injection:

Symfony\Component\DependencyInjection\Exception\RuntimeException

Cannot autowire service "Vendor\Example\Domain\JobData": argument "$pageRepository" of method "__construct()" references class "TYPO3\CMS\Frontend\Page\PageRepository" but no such service exists.

The problem was that the class TYPO3\CMS\Frontend\Page\PageRepository is an old name; the new one is TYPO3\CMS\Core\Domain\Repository\PageRepository. Using that one works.

Christian Weiske Christian Weiske
owner

History