WSOD on 3.3 - ImageViewBuilder service issues

Created on 26 February 2024, 10 months ago
Updated 12 March 2024, 10 months ago

It appears as though the dependency injection for the ImageViewBuilder is failing to take for whatever reason. Anywhere Twig Tweak is being used to render images on my site, I was receiving a WSOD. For now, I've downgraded to a static version of 3.2.

ArgumentCountError: Too few arguments to function Drupal\twig_tweak\View\ImageViewBuilder::__construct(), 0 passed in {homepath}/{webroot}/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 1 expected in Drupal\twig_tweak\View\ImageViewBuilder->__construct() (line 27 of {homepath}/{webroot}/modules/contrib/twig_tweak/src/View/ImageViewBuilder.php)

The service itself seems to be configured correctly, as well as the constructor. I'm not all too well versed in debugging dependency injection, so I'm passing this off.

πŸ› Bug report
Status

Fixed

Version

3.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States FrankieD3

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @FrankieD3
  • πŸ‡·πŸ‡ΊRussia Chi

    Cache clear?

  • πŸ‡ΊπŸ‡ΈUnited States FrankieD3

    Yes, I've cleared cache multiple times, both through Drush and the web UI. To note, this has happened on all three installs on this box using Twig Tweak.

  • πŸ‡·πŸ‡ΊRussia Chi

    You might need to clear opcache or restart your server.

  • πŸ‡ΊπŸ‡ΈUnited States FrankieD3

    I am unable to restart the server as it's a production environment, though I could potentially clear the opcache.

    Would you per chance know how to go about doing this in a WHM environment utilizing EasyApache?

  • πŸ‡·πŸ‡ΊRussia Chi

    I don't know. By some reason your services container is not rebuilding. You need to figure it out.

  • Status changed to Fixed 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States FrankieD3

    It seems to have taken a full module reinstallation to clear this up. No amount of cache invalidation seemed to allow for Drupal to recognize the new @image.factory argument for the twig_tweak.image_view_builder service.

    I have run into this issue in the past with my own module development, and I've yet to find a solution that doesn't take a reinstallation. Adding new keys to existing services in the YAML shouldn't introduce issues like this, yet I've run into this again and time again.

    I'll go ahead and mark this as fixed, although I'm curious to see if any others run into this. Thanks for your time.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024