RequireJS components sometimes not loading The Next CEO of Stack OverflowMagento2 not reading my requirejs-config.jsMagento 2 RequireJs callback not calledRequirejs shim option not workingMagento 2 from Bitnami on Amazon Lightsail VPS servers won't upgrade and requires reindexing all the timeProblems moving magento2 from shared cpanel to dedicated Centos 6 LAMP serverrequirejs-config.js compiling with wrong codeRequireJs magento2 loading custom js plugin results in DOMException: Failed to execute 'querySelectorAll'RequireJS fails loading required javascript with cache disabled, but only sometimesrequirejs-config, requirejs errorsIScroll not defined when loading with RequireJS?

Is it possible to make a 9x9 table fit within the default margins?

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

MT "will strike" & LXX "will watch carefully" (Gen 3:15)?

Upgrading From a 9 Speed Sora Derailleur?

How to unfasten electrical subpanel attached with ramset

Airship steam engine room - problems and conflict

That's an odd coin - I wonder why

How to find if SQL server backup is encrypted with TDE without restoring the backup

Could a dragon use its wings to swim?

How dangerous is XSS

What difference does it make matching a word with/without a trailing whitespace?

Prodigo = pro + ago?

How to coordinate airplane tickets?

Is a distribution that is normal, but highly skewed, considered Gaussian?

Are British MPs missing the point, with these 'Indicative Votes'?

Early programmable calculators with RS-232

Direct Implications Between USA and UK in Event of No-Deal Brexit

The sum of any ten consecutive numbers from a fibonacci sequence is divisible by 11

Gauss' Posthumous Publications?

Man transported from Alternate World into ours by a Neutrino Detector

Can a PhD from a non-TU9 German university become a professor in a TU9 university?

Why did the Drakh emissary look so blurred in S04:E11 "Lines of Communication"?

Is this a new Fibonacci Identity?

What is the difference between 'contrib' and 'non-free' packages repositories?



RequireJS components sometimes not loading



The Next CEO of Stack OverflowMagento2 not reading my requirejs-config.jsMagento 2 RequireJs callback not calledRequirejs shim option not workingMagento 2 from Bitnami on Amazon Lightsail VPS servers won't upgrade and requires reindexing all the timeProblems moving magento2 from shared cpanel to dedicated Centos 6 LAMP serverrequirejs-config.js compiling with wrong codeRequireJs magento2 loading custom js plugin results in DOMException: Failed to execute 'querySelectorAll'RequireJS fails loading required javascript with cache disabled, but only sometimesrequirejs-config, requirejs errorsIScroll not defined when loading with RequireJS?










3















We are launching a Magento 2.1.3 site, and finding that the site will sometimes load all of its Javascript components and dependencies properly, but sometimes fails to load, in which case a slider is not displayed and the console log shows error messages such as "Uncaught TypeError: $(...).swMegamenu is not a function".



How would we go about troubleshooting and resolving the source of these issues?










share|improve this question
















bumped to the homepage by Community 14 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • hope fully their might be a JQuery conflict.Try to short out the conflict.

    – Mujahidh
    Jan 13 '17 at 3:57











  • Please post your js code.

    – Rakesh Jesadiya
    Jan 13 '17 at 5:12











  • The relevant code causing the error I included is: <script type="text/javascript"> require([ 'jquery', 'Smartwave_Megamenu/js/sw_megamenu' ], function ($) $(".sw-megamenu").swMegamenu(); ); </script>

    – Gordon Krauthamer
    Jan 13 '17 at 14:05












  • We're observing today that the site will load the components on a normal reload, but not on a hard reload.

    – Gordon Krauthamer
    Jan 13 '17 at 14:11











  • Also, the problems seem to only occur in Magento production mode, not developer mode.

    – Gordon Krauthamer
    Jan 13 '17 at 15:17















3















We are launching a Magento 2.1.3 site, and finding that the site will sometimes load all of its Javascript components and dependencies properly, but sometimes fails to load, in which case a slider is not displayed and the console log shows error messages such as "Uncaught TypeError: $(...).swMegamenu is not a function".



How would we go about troubleshooting and resolving the source of these issues?










share|improve this question
















bumped to the homepage by Community 14 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • hope fully their might be a JQuery conflict.Try to short out the conflict.

    – Mujahidh
    Jan 13 '17 at 3:57











  • Please post your js code.

    – Rakesh Jesadiya
    Jan 13 '17 at 5:12











  • The relevant code causing the error I included is: <script type="text/javascript"> require([ 'jquery', 'Smartwave_Megamenu/js/sw_megamenu' ], function ($) $(".sw-megamenu").swMegamenu(); ); </script>

    – Gordon Krauthamer
    Jan 13 '17 at 14:05












  • We're observing today that the site will load the components on a normal reload, but not on a hard reload.

    – Gordon Krauthamer
    Jan 13 '17 at 14:11











  • Also, the problems seem to only occur in Magento production mode, not developer mode.

    – Gordon Krauthamer
    Jan 13 '17 at 15:17













3












3








3








We are launching a Magento 2.1.3 site, and finding that the site will sometimes load all of its Javascript components and dependencies properly, but sometimes fails to load, in which case a slider is not displayed and the console log shows error messages such as "Uncaught TypeError: $(...).swMegamenu is not a function".



How would we go about troubleshooting and resolving the source of these issues?










share|improve this question
















We are launching a Magento 2.1.3 site, and finding that the site will sometimes load all of its Javascript components and dependencies properly, but sometimes fails to load, in which case a slider is not displayed and the console log shows error messages such as "Uncaught TypeError: $(...).swMegamenu is not a function".



How would we go about troubleshooting and resolving the source of these issues?







magento-2.1 performance requirejs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 13 '17 at 14:11







Gordon Krauthamer

















asked Jan 13 '17 at 3:29









Gordon KrauthamerGordon Krauthamer

161




161





bumped to the homepage by Community 14 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 14 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • hope fully their might be a JQuery conflict.Try to short out the conflict.

    – Mujahidh
    Jan 13 '17 at 3:57











  • Please post your js code.

    – Rakesh Jesadiya
    Jan 13 '17 at 5:12











  • The relevant code causing the error I included is: <script type="text/javascript"> require([ 'jquery', 'Smartwave_Megamenu/js/sw_megamenu' ], function ($) $(".sw-megamenu").swMegamenu(); ); </script>

    – Gordon Krauthamer
    Jan 13 '17 at 14:05












  • We're observing today that the site will load the components on a normal reload, but not on a hard reload.

    – Gordon Krauthamer
    Jan 13 '17 at 14:11











  • Also, the problems seem to only occur in Magento production mode, not developer mode.

    – Gordon Krauthamer
    Jan 13 '17 at 15:17

















  • hope fully their might be a JQuery conflict.Try to short out the conflict.

    – Mujahidh
    Jan 13 '17 at 3:57











  • Please post your js code.

    – Rakesh Jesadiya
    Jan 13 '17 at 5:12











  • The relevant code causing the error I included is: <script type="text/javascript"> require([ 'jquery', 'Smartwave_Megamenu/js/sw_megamenu' ], function ($) $(".sw-megamenu").swMegamenu(); ); </script>

    – Gordon Krauthamer
    Jan 13 '17 at 14:05












  • We're observing today that the site will load the components on a normal reload, but not on a hard reload.

    – Gordon Krauthamer
    Jan 13 '17 at 14:11











  • Also, the problems seem to only occur in Magento production mode, not developer mode.

    – Gordon Krauthamer
    Jan 13 '17 at 15:17
















hope fully their might be a JQuery conflict.Try to short out the conflict.

– Mujahidh
Jan 13 '17 at 3:57





hope fully their might be a JQuery conflict.Try to short out the conflict.

– Mujahidh
Jan 13 '17 at 3:57













Please post your js code.

– Rakesh Jesadiya
Jan 13 '17 at 5:12





Please post your js code.

– Rakesh Jesadiya
Jan 13 '17 at 5:12













The relevant code causing the error I included is: <script type="text/javascript"> require([ 'jquery', 'Smartwave_Megamenu/js/sw_megamenu' ], function ($) $(".sw-megamenu").swMegamenu(); ); </script>

– Gordon Krauthamer
Jan 13 '17 at 14:05






The relevant code causing the error I included is: <script type="text/javascript"> require([ 'jquery', 'Smartwave_Megamenu/js/sw_megamenu' ], function ($) $(".sw-megamenu").swMegamenu(); ); </script>

– Gordon Krauthamer
Jan 13 '17 at 14:05














We're observing today that the site will load the components on a normal reload, but not on a hard reload.

– Gordon Krauthamer
Jan 13 '17 at 14:11





We're observing today that the site will load the components on a normal reload, but not on a hard reload.

– Gordon Krauthamer
Jan 13 '17 at 14:11













Also, the problems seem to only occur in Magento production mode, not developer mode.

– Gordon Krauthamer
Jan 13 '17 at 15:17





Also, the problems seem to only occur in Magento production mode, not developer mode.

– Gordon Krauthamer
Jan 13 '17 at 15:17










1 Answer
1






active

oldest

votes


















0














Hope fully their might be a JQuery conflict.Try to short out the



You can assign a variable.You should add the below line of code where swMegamenu located in.



var jq = jQuery.noConflict();


and use the variable jq instead of $ like jq(...).swMegamenu



Hope fully this might help you.






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f154556%2frequirejs-components-sometimes-not-loading%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Hope fully their might be a JQuery conflict.Try to short out the



    You can assign a variable.You should add the below line of code where swMegamenu located in.



    var jq = jQuery.noConflict();


    and use the variable jq instead of $ like jq(...).swMegamenu



    Hope fully this might help you.






    share|improve this answer



























      0














      Hope fully their might be a JQuery conflict.Try to short out the



      You can assign a variable.You should add the below line of code where swMegamenu located in.



      var jq = jQuery.noConflict();


      and use the variable jq instead of $ like jq(...).swMegamenu



      Hope fully this might help you.






      share|improve this answer

























        0












        0








        0







        Hope fully their might be a JQuery conflict.Try to short out the



        You can assign a variable.You should add the below line of code where swMegamenu located in.



        var jq = jQuery.noConflict();


        and use the variable jq instead of $ like jq(...).swMegamenu



        Hope fully this might help you.






        share|improve this answer













        Hope fully their might be a JQuery conflict.Try to short out the



        You can assign a variable.You should add the below line of code where swMegamenu located in.



        var jq = jQuery.noConflict();


        and use the variable jq instead of $ like jq(...).swMegamenu



        Hope fully this might help you.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 13 '17 at 4:02









        MujahidhMujahidh

        1,41512036




        1,41512036



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f154556%2frequirejs-components-sometimes-not-loading%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?