Issue 1:
Q
A

Bug report?
yes

Feature request?
no

BC Break report?
no

RFC?
no

Symfony version
4.0.0

Hi, sorry if the question looks silly but I am stucked for hours since the 4.0 version of Symfony.

In my AuthController I am trying to redirect the user to the homepage by using $this->redirectToRoute('home') but I get the following error :

The "router" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

with these details :

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
The "router" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.

at vendor/symfony/dependency-injection/Container.php:252
at Symfony\Component\DependencyInjection\Container->get('router')
(vendor/symfony/framework-bundle/Controller/ControllerTrait.php:73)
at Symfony\Bundle\FrameworkBundle\Controller\Controller->generateUrl('home', array())
(vendor/symfony/framework-bundle/Controller/ControllerTrait.php:110)
at Symfony\Bundle\FrameworkBundle\Controller\Controller->redirectToRoute('home')
(src/Controller/AuthController.php:33)
at App\Controller\AuthController->login()
at call_user_func_array(array(object(AuthController), 'login'), array())
(vendor/symfony/http-kernel/HttpKernel.php:151)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:66)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:190)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:30)

I installed the framework extra bundle, and of course extended my class to Controller.

It worked well before I upgraded to this new version.

Any ideas please ? :(

Thank you

Issue 2:
Q
A

Bug report?
yes

Feature request?
no

BC Break report?
no

RFC?
yes/no

Symfony version
3.4

I got the following deprecation after updating to Symfony 3.4:

User Deprecated: The "router" service is private, getting it from the container is deprecated since Symfony 3.2 and will fail in 4.0. You should either make the service public, or stop using the container directly and use dependency injection instead.

Error:

"exception" => ErrorException {#2303 ▼

#message: "User Deprecated: The "router" service is private, getting it from the container is deprecated since Symfony 3.2 and will fail in 4.0. You should either make the service public, or stop using the container directly and use dependency injection instead."

#code: 0

#file: "vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php"

#line: 275

#severity: E_USER_DEPRECATED

trace: {▼

vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:275 {▶}

vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php:85 {▶}

src/AppBundle/Controller/Backend/DashboardController.php:16 {▼

› ->setPageTitle('Dashboard')

› ->addBreadcrumb('Dashboard', $this->generateUrl('backend.dashboard'), 'dashboard')

› ;

}

AppBundle\Controller\Backend\DashboardController->indexAction() {}

vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:153 {▶}

vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68 {▶}

vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:202 {▶}

web/app_dev.php:33 {▶}

}

}