- 🇺🇸United States hotwebmatter Providence, Rhode Island, USA
For what it's worth, I've duplicated the bug on a clean install of Drupal 9.5.3 while attempting to scan my Sessionize Embed Block → contrib module.
Error message
Error while parsing Sessionize Embed Block 1.0.1.Fail while processing Sessionize Embed Block 1.0.1
Raw rector output shown below for debugging purposes. If you believe the errors are due to the tool used not the code processed, look for an existing issue or submit a new one for Drupal-rector.[ERROR] Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator::__construct(): Argument #1 ($container) must be of type Symfony\Component\DependencyInjection\ContainerBuilder, RectorPrefix202302\Symfony\Component\DependencyInjection\ContainerBuilder given, called in /var/www/html/vendor/rector/rector/vendor/symfony/dependency-injection/Loader/PhpFileLoader.php on line 67
The Rector project GitHub issue linked in the issue summary above contains a possible workaround, but it involves patching the
rector.php
file. Unfortunately, there are severalrector.php
files in my vendor directory, and it's not clear which one I should patch:$ find . -name rector.php ./vendor/rector/rector/vendor/rector/extension-installer/rector.php ./vendor/rector/rector/vendor/rector/rector-symfony/rector.php ./vendor/rector/rector/vendor/rector/rector-doctrine/rector.php ./vendor/rector/rector/vendor/rector/rector-phpunit/rector.php ./vendor/rector/rector/vendor/rector/rector-php-parser/rector.php ./vendor/rector/rector/vendor/symplify/easy-parallel/rector.php ./vendor/rector/rector/bin/rector.php ./vendor/drush/drush/rector.php ./vendor/palantirnet/drupal-rector/rector.php
- 🇺🇸United States agentrickard Georgia (US)
They probably mean the rector.php file in your project root.
- Status changed to Postponed: needs info
about 2 years ago 3:11pm 14 February 2023 - 🇺🇸United States agentrickard Georgia (US)
You should also try updating to release 15, which might have fixed the issue.
Once we make newer releases, older releases are no longer supported, since Rector itself frequently introduces breaking changes.
Please update your installation and report back.
- Status changed to Closed: works as designed
about 2 years ago 3:21pm 17 February 2023 - 🇺🇸United States moshe weitzman Boston, MA
I got this error too. I had to re-run the copy for this project -
cp vendor/palantirnet/drupal-rector/rector.php .
- 🇩🇪Germany tfranz
I got this error, too:
[ERROR] Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator::__construct(): Argument #1 ($container) must be of type Symfony\Component\DependencyInjection\ContainerBuilder, RectorPrefix202302\Symfony\Component\DependencyInjection\ContainerBuilder given, called in /var/www/html/vendor/rector/rector/vendor/symfony/dependency-injection/Loader/PhpFileLoader.php on line 67
Drupal 9.5.3
rector/rector 0.15.18
palantirnet/drupal-rector: 0.15.1
drupal/upgrade_rector: 1.0.0-alpha8 - Status changed to Active
about 2 years ago 9:47pm 2 March 2023 - 🇺🇸United States euk
It doesn't work for me. Using Drupal 9.4.10.
Can somebody please provide definitive steps to fix this issue?
Copyingrector.php
doesn't help. - 🇺🇸United States kwfinken Lansing, MI
Still an issuecd :
[ERROR] Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConf igurator::__construct(): Argument #1 ($container) must be of type Symfony\Component\DependencyInjection\ContainerBuilder, RectorPrefix202304\Symfony\Component\DependencyInjection\ContainerBuild er given, called in /opt/drupal/vendor/rector/rector/vendor/symfony/dependency-injection/Lo ader/PhpFileLoader.php on line 67
I tried
cp /opt/drupal/vendor/palantirnet/drupal-rector/rector.php /opt/drupal
but to no avail. - 🇮🇳India Sana.Neyazi
I am also getting this same issue. Copying rector.php (cp vendor/palantirnet/drupal-rector/rector.php ) and pasted at project root but it doesn't help
[ERROR] Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator::__construct(): Argument #1 ($container) must be of type Symfony\Component\DependencyInjection\ContainerBuilder, RectorPrefix202302\Symfony\Component\DependencyInjection\ContainerBuilder given, called in /var/www/html/vendor/rector/rector/vendor/symfony/dependency-injection/Loader/PhpFileLoader.php on line 67
- 🇲🇽Mexico eliasdelatorre
Getting the same issue when running rector against a custom module, tried copying rector.php file as directed, but issue still happening in said custom module and contrib modules like Address, Admin Toolbar and GraphQL:
[ERROR] Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator::__construct(): Argument #1 ($container) must be of type Symfony\Component\DependencyInjection\ContainerBuilder, RectorPrefix202304\Symfony\Component\DependencyInjection\ContainerBuilder given, called in /app/vendor/rector/rector/vendor/symfony/dependency-injection/Loader/PhpFileLoader.php on line 67
- 🇵🇹Portugal JonasSavs
Hey all,
I was able to fix this issue by copying:
cp ./vendor/palantirnet/drupal-rector/rector.php ./web/modules/contrib/upgrade_rector/rector-config-template.php
Hope it helps you all.
- Status changed to Needs work
almost 2 years ago 2:02am 27 May 2023 - 🇺🇸United States mlncn Minneapolis, MN, USA
JonasSavs answer in #15 fixed it for us. Is that something that can be patched?
- 🇺🇸United States jmarkel
Also jumping in to say that JonasSavs answer (in #15) fixed it for me.
- 🇦🇺Australia gordon Melbourne
#15 resolved it for me, but I have also created a patch so that I can included this to make it repeatable when I install this.
- Status changed to Needs review
over 1 year ago 2:41pm 17 July 2023 - Status changed to Closed: outdated
over 1 year ago 5:59pm 2 December 2023