Cannot read property 'AccordionMenu' of undefined - responsiveMenu

I’m getting a javascript error when using a Drilldown Dropdown Menu, with Responsive Menu.

I’m including the JS modules individually…

    'foundation.core.min.js',
    'foundation.util.box.min.js',
    'foundation.util.keyboard.min.js',
    'foundation.util.mediaQuery.min.js',
    'foundation.util.nest.min.js',
    'foundation.util.motion.min.js',
    'foundation.util.triggers.min.js',
    'foundation.drilldown.min.js',
    'foundation.dropdownMenu.min.js',
    'foundation.responsiveToggle.min.js',
    'foundation.offcanvas.min.js',
    'foundation.responsiveMenu.min.js',

I’m not using the Accordion Menu anywhere. However, i get the following error…

Uncaught TypeError: Cannot read property 'AccordionMenu' of undefined
    at Module../js/foundation.responsiveMenu.js (166dbe891706016f43f5a85d66ab328c-1621594334:31)

If I include everything it works as expected, and if I include accordionMenu and util.touch then it works as expected. But as I understand, there should be no dependency/requirement for accordionMenu to be included.

Is this a bug, or am I doing something wrong?

I’ve only got it to work with:
foundation.accordionMenu.min.js

I believe it’s required by responsiveMenu as the submenu that displays here is generated by the accordion menu:

https://get.foundation/sites/docs/responsive-navigation.html

1 Like