Announcement

Collapse
No announcement yet.

Javascript Error flagged in the console

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Javascript Error flagged in the console

    I haven't been able to understand why this broke. How do I solve this?

    Code:
        Uncaught TypeError: Cannot read properties of null (reading 'querySelectorAll')
        at S.fn.init.$.fn.transfigureNavigation (json.mvc?Store_Code=S&Function=JavaScriptCombined Resource_Output&JavaScriptCombinedResource_Code=sc ripts&T=577a8120:809:45)
        at Object.init (json.mvc?Store_Code=S&Function=JavaScriptCombined Resource_Output&JavaScriptCombinedResource_Code=sc ripts&T=577a8120:1870:27)
        at json.mvc?Store_Code=S&Function=JavaScriptCombinedR esource_Output&JavaScriptCombinedResource_Code=scr ipts&T=577a8120:2294:21
        at json.mvc?Store_Code=S&Function=JavaScriptCombinedR esource_Output&JavaScriptCombinedResource_Code=scr ipts&T=577a8120:2303:2
    I don't know if this helps describe what is being flagged, This is the JS code at 809:

    Code:
    $.fn.transfigureNavigation = function (container) {
        const navigationExtension = document.querySelector('[data-hook="transfigure-navigation"]');
        const topLevelLinks = navigationExtension.querySelectorAll('.x-transfigure-navigation__link');
        let clientPort = document.documentElement.clientWidth;
        let waitForIt;
    code at 1870:

    Code:
            /**
             * Initialize the Transfigure Navigation extension
             */
             $.hook('has-drop-down').transfigureNavigation();
    code at 2294:

    Code:
    /**
    * Initialize Extensions Functions
    */
    themeFunctionality.init();
    The code at 2303 is a closing curly bracket.

    This is the only error in the console for the whole store. The only side effect appears to be in media breaks where the cat tree menu is collapsed. The open button ( + ) is even hidden.

    Scott
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    #2
    Hi Scott,

    My initial thought is that the site is not using the default Transfigure Navigation extension. If that's the case, you can remove the code at 1870 which initializes the extension.
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      I guess it's possible. I think I had to not initialize the mini basket to get something else to work.

      Scott

      Yes, eliminated the console error. Thanks.

      Unfortunately, it didn't solve the show/hide issue I was having with the cat tree. It's also customized. I'll need to look at my code in that 'netherworld.

      Last edited by ids; 03-03-22, 04:31 PM.
      Need to offer Shipping Insurance?
      Interactive Design Solutions https://www.myids.net
      MivaMerchant Business Partner | Certified MivaMerchant Web Developer
      Competitive Rates, Custom Modules and Integrations, Store Integration
      AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
      My T-shirt Collection is mostly MivaCon T-shirts!!

      Comment

      Working...
      X