google chrome - Javascript error in production only -
i'm having trouble identifying javascript error happening in production only. error is:
uncaught typeerror: (intermediate value)(...) not function
with link line 22182 in file: https://d2wvl99qs6f2ce.cloudfront.net/js/358ee32eac3992e61f9fa13a0c55203d.js
clicking on link, chrome debugger shows error @ following line:
(function(jquery){
here excepts around line above:
/* * jquery selectbox styler v1.0.1 * http://dimox.name/styling-select-boxes-using-jquery-css/ * * copyright 2012 dimox (http://dimox.name/) * released under mit license. * * date: 2012.10.07 * */ (function($) { $.fn.selectbox = function(options) { ... } })(jquery) /* jquery.nicescroll -- version 3.5.0 beta5 -- copyright 2011-12-13 inuyaksa*2013 -- licensed under mit -- -- http://areaaperta.com/nicescroll -- https://github.com/inuyaksa/jquery.nicescroll -- */ (function(jquery){ ... })( jquery );
looking @ code , error, seems should change line:
})(jquery)
to
})(jquery);
this change consistent research error commonly caused missing semi-colon. but, when examining code used in development environment, same code (without semi-colon) not producing error. i've tried setting breakpoints before error can pause execution, add semi-colon, , continue execution hasn't been informative (maybe i'm using debug tools incorrectly...)
i'm struggling because:
the code in development , production environment same (checked via github comparison).
i can't replicate error in development environment limits ability debug.
the file, https://d2wvl99qs6f2ce.cloudfront.net/js/358ee32eac3992e61f9fa13a0c55203d.js, compilation of js files head of application. but, why chrome serving cloudfront?
what ways can begin identify source of problem? there way can modify code in chrome developer tools or firefox's firebug add semi-colon , continue execution? i've tried pasting javascript jsfiddle broke fiddle (file long paste). if makes difference, i'm building magento 1.9 application...
turns out answer related magento. in admin backend of magento, there option merge javascript errors (admin -> system -> configuration -> under advanced tab go click developer -> javascript settings -> merge javascript files). when javascript files merged, javascript errors ignored (such missing semi-colon in places) prior merge trigger errors. in case, javascript files being merged in production (for performance reasons) not in development environment.
in case, production environment merging javascript files while development environment not. since there missing semi-colon had noticed in file above (see question), code in production failing while code in development worked.
Comments
Post a Comment