Saturday, June 15, 2013

Symfony 2 JS Error in Production Only - Assetic Compression

If your JS files work perfectly in dev but not in production, it may be a compression issue indirectly caused by the Assetic bundle.

Make sure every single javascript file ends with a semi colon. The issue is that JS allows files to not end with semi colon, but when Assetic compresses and combines all JS files, the files are appended and causing incorrect syntax error.

No comments:

Post a Comment