微信浏览器script随机加载失败
很早之前反馈过相同的问题, 页面加载script随机出现加载失败的问题 总是报错Can't find variable xxx 或者xxx is undefined这种问题 from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16D57 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Thu Jan 02 20:17:41 CST 2020 window error, after page load 1122ms,log{"msg":"ReferenceError: Can't find variable: dealContentFile","url":"","line":927,"col":19,"error":{"line":927,"column":19,"sourceURL":""}} from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 12_1_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16D57 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Thu Jan 02 20:17:41 CST 2020 window error, after page load 1133ms,log{"msg":"ReferenceError: Can't find variable: EJS","url":"","line":1197,"col":35,"error":{"line":1197,"column":35,"sourceURL":""}} from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/4G Language/zh_CN} Thu Jan 02 20:17:53 CST 2020 window error, after page load 1179ms,log{"msg":"ReferenceError: Can't find variable: getCourseShare","url":"","line":925,"col":20,"error":{"line":925,"column":20,"sourceURL":""}} 问题中的js引入方式, 都是通过script标签, 非微信浏览器都正常 <script src="/mx-static/js/tmpl/ejs/ejs_production.js"></script> ps: 记得3年前反馈的时候, 微信的攻城狮联调过, 如果微信使用debug模式, 或者内置浏览器, 就不会出现问题了, 当时承诺发现问题后的半年, 也就是当年10月份可以上线解决, 但现在3年多都没解决, 我现在只想知道我怎么避免这种问题, 不报希望了!!!!!!!!!! ------ 补充新报错log JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:53:48 CST 2020 window error, after page load 56ms,log{"msg":"TypeError: undefined is not an object (evaluating 'document.getElementsByTagName('body')[0].appendChild')","url":"http://m.minstars.cn/mx-static/js/bootstrap/bootstrap.min.js?t=1570864964521","line":1,"col":137,"error":{"line":1,"column":137,"sourceURL":"http://m.minstars.cn/mx-static/js/bootstrap/bootstrap.min.js?t=1570864964521"}} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:53:48 CST 2020 window error, after page load 18ms,log{"msg":"Script error.","url":"","line":0,"col":0,"error":null} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:53:48 CST 2020 window error, after page load 21ms,log{"msg":"Script error.","url":"","line":0,"col":0,"error":null} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:53:48 CST 2020 window error, after page load 22ms,log{"msg":"TypeError: undefined is not an object (evaluating 'document.getElementsByTagName('body')[0].appendChild')","url":"http://m.minstars.cn/mx-static/js/cookie/jquery.cookie.js?t=1570864964521","line":1,"col":137,"error":{"line":1,"column":137,"sourceURL":"http://m.minstars.cn/mx-static/js/cookie/jquery.cookie.js?t=1570864964521"}} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:53:48 CST 2020 window error, after page load 720ms,log{"msg":"ReferenceError: Can't find variable: layer","url":"","line":618,"col":34,"error":{"line":618,"column":34,"sourceURL":""}} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:55:53 CST 2020 window error, after page load 43ms,log{"msg":"Script error.","url":"","line":0,"col":0,"error":null} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:55:53 CST 2020 window error, after page load 49ms,log{"msg":"TypeError: undefined is not an object (evaluating 'document.getElementsByTagName('body')[0].appendChild')","url":"http://m.minstars.cn/mx-static/js/cookie/jquery.cookie.js?t=1570864964521","line":1,"col":137,"error":{"line":1,"column":137,"sourceURL":"http://m.minstars.cn/mx-static/js/cookie/jquery.cookie.js?t=1570864964521"}} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:55:53 CST 2020 window error, after page load 48ms,log{"msg":"Script error.","url":"","line":0,"col":0,"error":null} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:55:53 CST 2020 window error, after page load 56ms,log{"msg":"TypeError: undefined is not an object (evaluating 'document.getElementsByTagName('body')[0].appendChild')","url":"http://m.minstars.cn/mx-static/js/bootstrap/bootstrap.min.js?t=1570864964521","line":1,"col":137,"error":{"line":1,"column":137,"sourceURL":"http://m.minstars.cn/mx-static/js/bootstrap/bootstrap.min.js?t=1570864964521"}} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/WIFI Language/zh_CN} Sat Jan 04 21:55:54 CST 2020 window error, after page load 480ms,log{"msg":"ReferenceError: Can't find variable: layer","url":"","line":618,"col":34,"error":{"line":618,"column":34,"sourceURL":""}} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/4G Language/zh_CN} Sat Jan 04 21:56:02 CST 2020 window error, after page load 9ms,log{"msg":"Script error.","url":"","line":0,"col":0,"error":null} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/4G Language/zh_CN} Sat Jan 04 21:56:02 CST 2020 window error, after page load 12ms,log{"msg":"Script error.","url":"","line":0,"col":0,"error":null} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/4G Language/zh_CN} Sat Jan 04 21:56:02 CST 2020 window error, after page load 50ms,log{"msg":"TypeError: undefined is not an object (evaluating 'document.getElementsByTagName('body')[0].appendChild')","url":"http://m.minstars.cn/mx-static/js/cookie/jquery.cookie.js?t=1570864964521","line":1,"col":137,"error":{"line":1,"column":137,"sourceURL":"http://m.minstars.cn/mx-static/js/cookie/jquery.cookie.js?t=1570864964521"}} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/4G Language/zh_CN} Sat Jan 04 21:56:02 CST 2020 window error, after page load 58ms,log{"msg":"TypeError: undefined is not an object (evaluating 'document.getElementsByTagName('body')[0].appendChild')","url":"http://m.minstars.cn/mx-static/js/bootstrap/bootstrap.min.js?t=1570864964521","line":1,"col":137,"error":{"line":1,"column":137,"sourceURL":"http://m.minstars.cn/mx-static/js/bootstrap/bootstrap.min.js?t=1570864964521"}} JsLogController.jsConsole->() from agent{Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.8(0x17000820) NetType/4G Language/zh_CN} Sat Jan 04 21:56:03 CST 2020 window error, after page load 801ms,log{"msg":"ReferenceError: Can't find variable: layer","url":"","line":618,"col":34,"error":{"line":618,"column":34,"sourceURL":""}}