Skip to content
Advertisement

Symfony, Request cannot find the service [closed]

When I try to run my code I get the following error message :

Cannot autowire argument $request of “AppControllerAppController::formulaire()”: it references class “symfonyComponentHttpFoundationRequest” but no such service exists.

I don’t understand as I followed tutorial and checked on symfony documentation and it looks fine!

my code is :

JavaScript

And I use the followings :

JavaScript

Everthing was fine until I added (Request $request)

Does anyone knows what is wrong ?

Advertisement

Answer

there is a typo when you import the Request class. you import from this namespace use symfonyComponentHttpFoundationRequest; with lower-case s. any import namespaces are case-sensitive. use this namespace. use SymfonyComponentHttpFoundationRequest;

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement