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

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form