Lib-menu not working

Enonic version: 7.7.3
OS: Windows

Trying to use the lib-menu;
following this doc https://github.com/enonic/lib-menu, but attempting to use
let menuItems = libs.menu.getMenuTree(2);
in a Page controller (.js) returns

Caused by: jdk.nashorn.internal.runtime.ECMAException: TypeError: Cannot read property “ariaLabel” from undefined

Attempt with
let menuItems = libs.menu.getMenuTree(2, { returnContent = true }); returns

Caused by: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: “returnContent” is not defined

Its like the lib is not there - I’ve manually stopped, built and deployed after adding the depenency/code.
Or rather, it finds the getMenuTree(), but not the internal things in there like “ariaLabel” and “returnContent”

1 Like

I think that bug is fixed in com.enonic.lib:lib-menu:4.0.1 :slight_smile:

– Tom

1 Like

Changing the dependency to 4.0.1 fixed it :+1:
I just blindly followed the README.md (first link), which tells you to use “4.0.0”

1 Like

@JonasR I recommend opening an issue on Github or even better posting a pull request if you find incorrect documentation.

It’s a simple way to help out the community. :slight_smile:

1 Like

Update the readme now, to 4.0.1. So others can blindly follow the readme :wink:

1 Like