문제

I'm trying to put a Symfony 2 app in production mode. It all runs fine except for the fact that the compressed single javascript file causes errors and makes the site unable to render correctly. I found this through the debug console on the browser:

Uncaught TypeError: undefined is not a function
Uncaught TypeError: Object [object Object] has no method 'treeview'

The first error refers to Jquery plug-ins The treeview refers to a plugin for Jquery wich renders a tree like directory structure.

On the other hand, it all runs fine on dev mode cause it doesn't do the compression and it just includes every file one by one. Can someone help me on this one? Thanks in advance.

도움이 되었습니까?

해결책

I've found a solution to this, it appears the issue is related to missing semi-colons. When something is the last statement in a js file a semi-colon isn't required however assetic just joins the files together and only adds a new line.

Check the file which is being included just before the broken plugin javascript and make sure it ends with a semicolon.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top