Skip to content

Fix "Definition could not be converted to string" error #846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

sadikoff
Copy link
Contributor

This will fix #845

@nicolas-grekas Can you confirm that this code will work as expected?

@nicolas-grekas
Copy link
Member

Would you be able to provide me with a reproducer? I'd like to see what this Definition is about.

@sadikoff
Copy link
Contributor Author

sadikoff commented Mar 23, 2021

Configured for php7.4 https://github.com/sadikoff/maker-bundle-bug-reproducer
Steps:

  1. Install dependencies symfony composer install
  2. Try to install maker symfony composer require maker
    Error

Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!! Error {#3158
!! #message: "Object of class Symfony\Component\DependencyInjection\Definition could not be converted to string"
!! #code: 0
!! #file: "./vendor/symfony/maker-bundle/src/DependencyInjection/CompilerPass/SetDoctrineAnnotatedPrefixesPass.php"
!! #line: 41
!! trace: {
!! ./vendor/symfony/maker-bundle/src/DependencyInjection/CompilerPass/SetDoctrineAnnotatedPrefixesPass.php:41 { …}
!! ./vendor/symfony/dependency-injection/Compiler/Compiler.php:91 { …}
!! ./vendor/symfony/dependency-injection/ContainerBuilder.php:736 { …}
!! ./vendor/symfony/http-kernel/Kernel.php:541 { …}
!! ./vendor/symfony/http-kernel/Kernel.php:780 { …}
!! ./vendor/symfony/http-kernel/Kernel.php:121 { …}
!! ./vendor/symfony/framework-bundle/Console/Application.php:168 { …}
!! ./vendor/symfony/framework-bundle/Console/Application.php:74 { …}
!! ./vendor/symfony/console/Application.php:166 { …}
!! ./bin/console:43 {
!! › $application = new Application($kernel);
!! › $application->run($input);
!! ›
!! arguments: {
!! $input: Symfony\Component\Console\Input\ArgvInput {#5 …}
!! }
!! }
!! }
!! }
!! 2021-03-23T09:37:07+00:00 [critical] Uncaught Error: Object of class Symfony\Component\DependencyInjection\Definition could not be converted to string
!!
Script @auto-scripts was called via post-update-cmd

PS @nicolas-grekas be sure to pull the latest changes from the reproducer 😃

@nicolas-grekas
Copy link
Member

Thanks for the PR and the reproducer, I created #847 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal error on cache:clear with 1.30.1
2 participants