Issue Bug Rejected

#105504styleguide: Dependency Injection fails with classic TYPO3 installation

Franz Holzinger 10/28/24, 17:29 updated 11/19/24, 13:08

Description

After an activation of the latest styleguide 13.4.1 the backend is gone with an error message.

  • Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
    Expected to find class “TYPO3\CMS\Styleguide\Command\GeneratorCommand” in file “/path/demoshop13/typo3conf/ext/styleguide/Classes/Command/GeneratorCommand.php” while importing services from resource “../Classes/*”, but it was not found! Check the namespace prefix used with the resource.*

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 2

History 7

  1. Garvin Hicking commented and changed category status New Needs Feedback 10/29/24, 07:44

    Hi!

    Can you please give more details, what environment are you using here? How are you using the 13.4.1 version of TYPO3 in classic mode, did you create your own tarball? Or are you trying to use styleguide in 13.4.1-dev (there’s no 13.4.1 yet) in a 13.4.0 environment?! Also, EXT:styleguide is only available in a 12.4 compatible version from TER…

    Regards,
    Garvin

  2. Franz Holzinger commented 11/04/24, 09:37

    I use the Github environment to download the extension stylesheet. Then I use the FTP to copy it to the server where I activate it in the EM.

    I have tried it again with Tag v13.1.1.

    But now comes this error:

    Fatal error: Type of TYPO3\CMS\Styleguide\TcaDataGenerator\FieldGenerator\TypePassthroughFieldL10nSource::$matchArray must not be defined (as in class TYPO3\CMS\Styleguide\TcaDataGenerator\FieldGenerator\AbstractFieldGenerator) in /path/typo3conf/ext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypePassthroughFieldL10nSource.php on line 27

  3. Garvin Hicking commented 11/04/24, 16:05

    Please use exactly the tag of your matching TYPO3 core version, in this case this should be 13.4.0.

    The Github repo however is aimed at providing the composer package, I’m not really this core-maintained extension can be simply copied like that, because it might have different core usage than a “normal” extension would have.

    But I have no experience with styleguide in a legacy environment. I think probably EXT:styleguide should be bundled with the TYPO3 tarball…

  4. Oliver Hader commented 11/05/24, 09:54

    ext:styleguide is not bundled in the tarball, and excluded during packaging https://github.com/TYPO3/darth/blob/78ddadc46dc4cc66f91c8953b0c48e9fd2e02d29/conf/release.yaml#L95-L96

    I tried installing the extension from GitHub exports, e.g.

    However that also failed on my side with Class "TYPO3\CMS\Styleguide\TcaDataGenerator\RecordFinder" not found when accessing the Styleguide backend module.

    I don’t have much time right now to dig deeper. Maybe @lolli can help here…

  5. Franz Holzinger commented 11/06/24, 08:30

    I have now used the tag v13.0.1, but as expected there is no difference. I rather think that the latest tag v13.1.1 uses the most recent code.

    I have ignored this requirement, because I use TYPO3 13.4.0.

    “require”: {
    “typo3/cms-core”: “13.0.1“
    },
  6. Franz Holzinger commented 11/06/24, 08:56

    I have used the wrong tag.

    Now comes a test with tag v13.4.0:
    Only this error happens in the backend module:

    Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
    Expected to find class “TYPO3\CMS\Styleguide\Command\GeneratorCommand” in file “/path/demoshop13/typo3conf/ext/styleguide/Classes/Command/GeneratorCommand.php” while importing services from resource “../Classes/*”, but it was not found! Check the namespace prefix used with the resource.
    in /path/typo3_src-13.4.0/vendor/symfony/dependency-injection/Loader/FileLoader.php line 338
  7. Benni Mack commented and changed status Needs Feedback Rejected 11/19/24, 13:08

    Dear Franz,

    this way is officially not supported. However, if you really want to make it work, please change the “type” in EXT:styleguide’s composer.json from “typo3-cms-framework” to “typo3-cms-extension” when using a system extension in typo3conf/ext and in classic mode. Be sure to run typo3/sysext/core/bin/typo3 dumpautoload afterwards.

    We won’t support this approach (styleguide in classic mode) in the future, as this extension is used for running TYPO3 Core tests and debugging for core development.