1
votes

I'm having a strange issue with a Symfony 2 deployment to production.

After running:
php app/console assets:install --env=prod
php app/console assetic:dump --env=prod

A css file is generated in web/css, for example "53xyz.css".

However, the twig template is outputting the url "53xyz_part_1_style_1.css" which is causing a 404.

Same goes for other assets using the asset_url in a stylesheets or javascripts block.

Has anyone run into this before?

1
Have you tried clearing the cache and then dumping the assets?acontell
I have. Same thing is happening. It starting to look like assetic still thinks it's running in dev.samizdat
the problem happens in prod environment, isn't it?acontell

1 Answers

0
votes

Ok. Just figured it out after more research.

In /web/app.php the line
$kernel = new AppKernel('prod', true);

needs to be:
$kernel = new AppKernel('prod', false);

The second flag is a debug flag that when it's set to true will generate the debug file names. When it's false, it'll use the file name you expect.