All Cache / Optimization plugins can potentially cause this problem if they are incorrectly configured. Of all the various plugins we see more issues from SG Optimizer then we do from Autoptimize.
If you wish to keep using SG Optimizer you will need to troubleshoot the problem, by disabling the plugins various options. This particular error is normally related to Combining / Minimize Javascripts.