ReferenceError: Main is not defined
-
Once I set “Enable Async JavaScript?”, I’m seeing this in the console…
ReferenceError: Main is not definedaventriahealth.com:639:1
<anonymous> https://aventriahealth.com/:639But I’m not sure which script (which are autopitized) this might be coming from.
The page I need help with: [log in to see the link]
-
wordfence is blocking me when trying to disable asyncjs/ autoptimize with querystring parameters tomn68, can’t troubleshoot like that I’m afraid :-/
Ugh. Yeah I suspect we’re blocking countries and I can’t change that. Bummer. Anything I can try on my end?
Tom
well, what I do is run the page with ?ao_noptimize=1 (disabling Autoptimize) and ?aj_noptimize=1 (disabling AsyncJS) and compare results to see in which case(s) things work as a first step.
ao_notimize
?ao_noptimize=1:894 Uncaught ReferenceError: Main is not defined
at ?ao_noptimize=1:894
(anonymous) @ ?ao_noptimize=1:894
jquery-migrate.min.js?ver=1.4.1:2 JQMIGRATE: Migrate is installed, version 1.4.1
?ao_noptimize=1:209 Uncaught TypeError: jQuery(…).slicknav is not a function
at HTMLDocument.<anonymous> (?ao_noptimize=1:209)
at i (jquery.js?ver=1.12.4-wp:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
at Function.ready (jquery.js?ver=1.12.4-wp:2)
at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)
(anonymous) @ ?ao_noptimize=1:209
i @ jquery.js?ver=1.12.4-wp:2
fireWith @ jquery.js?ver=1.12.4-wp:2
ready @ jquery.js?ver=1.12.4-wp:2
J @ jquery.js?ver=1.12.4-wp:2
?ao_noptimize=1:1 A cookie associated with a cross-site resource at https://app-sj11.marketo.com/ was set without theSameSite
attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set withSameSite=None
andSecure
. You can review cookies in developer tools under Application>Storage>Cookies and see more detailwith aj_noptize=1 I only get…
JQMIGRATE: Migrate is installed, version 1.4.1
?aj_noptimize=1:1 A cookie associated with a cross-site resource at https://app-sj11.marketo.com/ was set without theSameSite
attribute. It has been blocked, as Chrome now only delivers cookies with cross-site requests if they are set withSameSite=None
andSecure
. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.THen in sources when using ?ao_noptimize=1 I see the exception on Main.boot below
</script><script type=’text/javascript’ async=’async’ src=’https://aventriahealth.com/wp-content/plugins/responsive-navigation/assets/js/jquery.slicknav.js?ver=1.0′></script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-includes/js/jquery/ui/core.min.js?ver=1.11.4′></script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-includes/js/jquery/ui/widget.min.js?ver=1.11.4′></script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-includes/js/jquery/ui/mouse.min.js?ver=1.11.4′></script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-includes/js/jquery/ui/sortable.min.js?ver=1.11.4′></script>
<script type=’text/javascript’ async=’async’ src=’https://aventriahealth.com/wp-content/plugins/responsive-accordion-and-collapse/js/bootstrap.js?ver=54466f2d8726088b385ce732b570e25a’></script>
<script type=’text/javascript’ async=’async’ src=’https://aventriahealth.com/wp-content/plugins/responsive-accordion-and-collapse/js/accordion.js?ver=54466f2d8726088b385ce732b570e25a’></script>
<script type=’text/javascript’ async=’async’ src=’https://aventriahealth.com/wp-content/plugins/simple-share-buttons-adder/js/ssba.js?ver=54466f2d8726088b385ce732b570e25a’></script>
<script type=’text/javascript’>
Main.boot( [] );
</script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-includes/js/imagesloaded.min.js?ver=3.2.0′></script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-includes/js/masonry.min.js?ver=3.3.2′></script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-includes/js/jquery/jquery.masonry.min.js?ver=3.1.2b’></script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-content/plugins/templatesnext-toolkit/js/owl.carousel.min.js?ver=1.3.2′></script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-content/plugins/templatesnext-toolkit/js/jquery.colorbox-min.js?ver=1.5.14′></script>
<script type=’text/javascript’ defer=’defer’ src=’https://aventriahealth.com/wp-content/plugins/templatesnext-toolkit/js/jquery.inview.min.js?ver=1.0.0′></script>
<script type=’text/javascript’ async=’async’ src=’https://aventriahealth.com/wp-content/plugins/templatesnext-toolkit/js/tx-script.js?ver=2013-07-18′></script>
<script type=’text/javascript’>
/* <![CDATA[ */
var themeMyLogin = {“action”:””,”errors”:[]};
/* ]]> */Was any of this helpful?
sorry, hadn’t seen previous comments.
can you try excluding
plugins/simple-share-buttons-adder/
from async JS?Yup. That did it.
The only one I have left is…
(index):196 Uncaught TypeError: jQuery(…).slicknav is not a function
at HTMLDocument.<anonymous> ((index):196)
at i (jquery.js?ver=1.12.4-wp:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
at Function.ready (jquery.js?ver=1.12.4-wp:2)
at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)I couldn’t find a slicknav plugin though. Maybe part of the them. Will try to track it down(disabled the Async for now) unless you have some ideas. Thanks again for the help.
disable JS optimization in Autopitmize for a second to see the original filenames, you’ll probably see slicknav that way.
Thanks. So I did find it. Best to just exclude the Responsive Navigation plugin or just the script?
I excluded the plugin and I think works.
Tom
if it works, just leave as is ??
- The topic ‘ReferenceError: Main is not defined’ is closed to new replies.