Bug #102092
Updated by John Miller 11 months ago
Just updated to the latest TYPO3 CMS dev-main. Container builder throws <pre><code class="php"> (1/1) Symfony\Component\DependencyInjection\Exception\RuntimeException Cannot autowire service "TYPO3\CMS\Core\Routing\PageArguments": argument "$pageId" of method "__construct()" is type-hinted "int", you should configure its value explicitly. </code></pre> Am not autowiring it in my extension and have no third-party extensions. Tried both @12.4-dev@ & @dev-main@ . See screenshots. Same result. *Problem* Autowiring @\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController@ \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController doesn't work. I had autowired @TypoScriptFrontendController@ this class in a constructor in one file and in a property in a separate file. two different files. The @TypoScriptFrontendController@ class file requires the @PageArguments@ class in its constructor, which in turn, is autowired but has scalar values for its constructor. Same goes for the two more parameters in the @TypoScriptFrontendController@ . *Solution* Avoid autowiring @\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController@ . Instead use, the @$GLOBALS['TSFE']@ . *Sentiments* I wish there was a way to easily get ready-made services straight from di container instead of using complex methods such as the @Aspects@ bag or @globals@. Also wish that there be single points of constructing objects in TYPO3. In chasing down the @PageArguments@ problem, I realized that it is constructed from multiple places. It's insane, especially for debugging and efficiency reasons. But that's just me.