Server Errors
Code |
Most likely cause |
400 |
Controller failed to return valid set of sources to serve |
500 |
Minifier threw exception (e.g. JSMin choked on syntax) |
You can find details by enabling FirePHP logging:
- Install/enable FirePHP.
- Open Firebug's console
- Set
$min_errorLogger = true;
in min/config.php
- Reload the Minify URL
Hopefully you'll see the error appear:
Javascript/CSS Problems
When Javascript errors occur, or URIs in CSS files are incorrectly rewritten, enable "debug mode" to ease debugging combined files:
- Set
$min_allowDebugFlag = 'true'
in min/config.php
- Append
&debug
to the Minify URI. E.g. /min/?f=script1.js,script2.js&debug
(or use the bookmarklet provided by /min/builder/)
In "debug mode":
- comments are inserted into the output showing you line numbers in the original file(s)
- no minification is performed
- In CSS, URI rewriting is performed
- In CSS, a leading comment shows how URIs were rewritten.
Example: a combination of two Javascript files in debug mode
Example: Top of CSS output in debug mode
Tips for handling Javascript errors
- Use the latest version (2.1.4 beta as of Dec 2010)
- Try debug mode to make the combined file more readable (and error locations findable)
- Find out if other browsers have the same error
- For pre-minified files, make the filenames end in
.min.js
or -min.js
, which will prevent Minify from altering them
- Test your scripts in JSLint.
See Also