• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Blank Page - Minify code bug ?

Status
Not open for further replies.

xsecret

Chevereto Member
Hi there,

I just bought this nice script but I have a strange issue, with browsers just displaying a blank page.

Setup:
Apache 2.4.10
PHP 5.6.20
All files 664, all folders 775. Apache/php both have access to group.
No errors in Apaches Logs.

Problem:
I tracked the issue down to the "Minify Code" settings. When disabled, everything is working just fine. But If I enable it, I get a blank page on Firefox & Chrome (fresh install). Both browsers receive HTML/JS code as expected but both show two errors that prevent a correct rendering :

Code:
(index):625 Uncaught TypeError: $.each is not a function(anonymous function)
(index):631 Uncaught ReferenceError: PF is not defined

These errors don't show when Minify option is disabled.

The first error come from here :

Code:
<script>(function($,d){$.each(readyQ,function(i,f){$(f)});$.each(bindReadyQ,function(i,f){$(d).bind("ready",f)})})(jQuery,document)</script>

The second error come from 2 JS inclusion later :

Code:
<script>
PF.obj.config.base_url = "http://myurl.com";
PF.obj.config.json_api = "http://myurl.com/json";
PF.obj.config.listing.items_per_page = "24";
....

Microsoft Edge reports similar errors in the Dev console, but seems to be able to bypass them and display the page.

Any guess?
 
Your webserver can't store the minified file, could be due to permissions or maybe a limitation in file related functions (fread, fwrite, etc). Just don't use minified code or fix your server setup.
 
Ok, I just auto-solved that. Please delete the thread if you think it's unrelated to any issue.

For some very strange reasons, I found 3 blank .min.js files : \lib\Peafowl\js\scripts.min.js, \lib\Peafowl\peafowl.min.js and \app\lib\chevereto.min.js. All other .min.js fine. Restoring theses files solved the issue.
 
Thing is that the minifier tooks the non-minified files and creates a minified version of it. It does that for JS and CSS. Usually if the min.ext file is there it means that the system wasn't able to read the source file but it was capable of store the final file (empty).

I think that this could be caused by permissions, PHP can't read the files as expected.
 
Yep, really strange. ie: According to files timestamps, peafowl.css was correctly minified to peafowl.min.css but peafowl.js resulted in a 0-byte file. All files have same permissions & owner. I probably messed somewhere when I set permissions.

Perhaps a suggestion: add a gzipped tarball in the download area. Linux standard unzip sometimes results in a big mess with 777 anywhere.

Anyway, thanks for your damn fast answer!
 
I never had that issue with permissions when unzipping. Most likely the problem is then the parser, if it creates the min.css and not min.js then the parser has issues in your server.
 
Status
Not open for further replies.
Back
Top