Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2: JavaScript doesn't work on Prod environment

In Dev enviroment it works perfectly, but when I switch to Prod it doesn't do anything. It looks like it doesn't attach the event listeners (when I inspect elements with Chrome, no event listener is detected where they should). Any ideas? I've cleared both caches and maybe it's important to say that I had copied

_assetic:
resource: .
type:     assetic

from routing_dev.yml to routing.yml because if I don't I got the following 500 Internal Server Error:

request.CRITICAL: Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Route "_assetic_f582f37" does not exist.")
like image 585
ikleiman Avatar asked Apr 21 '26 20:04

ikleiman


1 Answers

Have you dumped your asset files?

php app/console assetic:dump --env=prod --no-debug

http://symfony.com/doc/current/cookbook/assetic/asset_management.html#cookbook-assetic-dumping

like image 174
Matt Avatar answered Apr 23 '26 09:04

Matt