Assetic - Route "_assetic_001d5b7_0" does not exist

Viewed 15735

This question seems to have been asked multiple times but none of the solutions work for me.

I'm in my prod environment, here is what I've done:

  • cleared cache before/after doing anything
  • attempted commenting out the _assetic stuff in config_dev and ensure it isn't anywhere else (not that this should matter in prod env)
  • set use_controller to both true and false (obviously works with true but doesn't use the compiled files)

Is there anything else I'm missing? The files are generating completely fine from php app/console assetic:dump --env=prod --no-debug the file name matches that of in the error minus the route stuff.

9 Answers

Maybe you have removed the assetic routing from the app/routing_dev.yml

_assetic:
    resource: .
    type:     assetic

Like @Marcus said, if you tried:

php bin/console cache:clear

and it didn't help, please clear the your_project_root/var/cache folder manually (remove all folders and files). If you use unix/linux systems, and receive a system message like "Error removing file: Permission denied", you need to change accesses to dir first, for example you can use console command

sudo chmod -R 0777 /your_site_directory/var/cache/

and after this you can clear cache dir.

I encountered this issue in Symfony 3.3 after trying to override my Twig templates directory. Not sure how to fix the issue, but reverting to default templates directory config resolved the issue for now.

# config.yml
twig:
    paths: ["%kernel.project_dir%/templates"] # Remove this line to use default dir

After trying all the suggested solutions here, to me it was simply the issue with the name of the template. I had .twig but not .html.twig extension, that's all.

Related