Skip to content
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

Cannot autowire service JMSDITypeResolver #6246

Closed
alies-dev opened this issue Apr 26, 2021 · 9 comments
Closed

Cannot autowire service JMSDITypeResolver #6246

alies-dev opened this issue Apr 26, 2021 · 9 comments
Labels

Comments

@alies-dev
Copy link

alies-dev commented Apr 26, 2021

Bug Report

Subject Details
Rector version v0.10.11
Installed as composer dependency

Update rector update (from 0.10.10 to 0.10.11), we have got this error:

rector process '--dry-run'

Error: ] Cannot autowire service                                                
         "Rector\DependencyInjection\TypeAnalyzer\JMSDITypeResolver": argument  
         "$serviceMapProvider" of method "__construct()" references class       
         "Rector\Symfony\DataProvider\ServiceMapProvider" but no such service   
         exists.                                                                
@alies-dev alies-dev added the bug label Apr 26, 2021
@sabbelasichon
Copy link
Contributor

I guess this is due to the new rector-installer. Could you please do a composer install again. The rector-installer should autowire the config behind the scenes.

@TomasVotruba
Copy link
Member

That's due to new way we install Rector extensions:
#6174

composer install

Should invoke the composer plugin to install them

@TomasVotruba
Copy link
Member

But it shows our wrong architetcure... The AnnotatedPropertyInjectToConstructorInjectionRector now depends on rector-symfony package, so we should extra it there to own rule.

@alies-dev
Copy link
Author

I've got this error on CI, but probably we use a wrong caching strategy for composer install. I'll check it out, thanks!

@sabbelasichon
Copy link
Contributor

Are you running it with --no-scripts?

@TomasVotruba TomasVotruba mentioned this issue Apr 26, 2021
@alies-dev
Copy link
Author

@sabbelasichon
yes:

composer install -q --no-interaction --no-scripts --no-progress --prefer-dist --no-ansi

@sabbelasichon
Copy link
Contributor

I think that is the problem.

@TomasVotruba
Copy link
Member

@lptn If you use GitHub CI, this is the best way with cache included

- uses: "ramsey/composer-install@v1"

@alies-dev
Copy link
Author

alies-dev commented Apr 26, 2021

Hey @TomasVotruba and @sabbelasichon
yes, the issue caused by using --no-scripts composer’s option. I also needed to change composer install caching strategy, because composer install and composer install --no-scripts generates different output (and thus require to use different cache).

As usually, thanks a lot for your awesome product and super-fast responses 👍 .

TomasVotruba added a commit that referenced this issue Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants