We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Problem with jsmin

Hello We use the code $this->_assetsCollection ->addFilter(new \Phalcon\Assets\Filters\Jsmin()) ->join(true) ->setTargetPath($filePath);

$assetsManager->set('CompilationJSAssets', $this->_assetsCollection);

And when we call $assetsManager->outputJs('CompilationJSAssets'); 502 error occurs

This error occurs only when we use new \Phalcon\Assets\Filters\Jsmin()

Probable something wasn't inslalled on the server side. Help us please.

Check logs maybe? But it looks like seg fault.



446

In php log I see nothing and in nginx log I see just 502 error.

edited Jul '17

Have you enabled verbose logging for both php and nginx?

error_reporting(E_ALL);
ini_set('display_errors', 'On');

https://nginx.org/en/docs/debugging_log.html

I had this happen to me and the issue was some of the syntax in my JS. Have you tried to divide and conquer your JS to see if some part of it is throwing an error.

Well above can be good point. Like missing ; in js code can cause a problem with minimizing it though it's kind of stupid, it should minimize anyway, just script should not work properly.