Symfony 2.1 - Uncaught PHP Exception Twig_Error_Runtime

Miloš picture Miloš · May 23, 2013 · Viewed 9k times · Source

I am getting this error when trying to open a route in Symfony 2.1

I realy have no idea where to check that. There is nothing on the internet.

Thank you very much for your help:

CRITICAL - Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "_wdt" as such route does not exist.") in "@WebProfiler/Profiler/toolbar_js.html.twig" at line 15." at /home/milos/workspace/merrin3.0/vendor/twig/twig/lib/Twig/Template.php line 280

Answer

Nicolai Fröhlich picture Nicolai Fröhlich · May 23, 2013

This Exception is thrown in the dev environment if the profiler is enabled but it's routing configuration is missing.

Unable to generate a URL for the named route "_wdt" as such route does not exist.

Please check that your app/config/routing_dev.yml contains the following lines:

# app/config/routing_dev.yml

_wdt:
    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
    prefix:   /_wdt

_profiler:
    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
    prefix:   /_profiler

This will fix your issue.