samizdat
samizdat

Reputation: 11

Symfony 2.5.9 - Url generated by asset_url isn't matching the actual file

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?

Upvotes: 1

Views: 57

Answers (1)

samizdat
samizdat

Reputation: 11

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.

Upvotes: 0

Related Questions