It seems that activating the caching has some influence on the css classes which should never be of course.


@andidhouse, have you written a custom menu template that applies the "active" class in PHP?
If so, you need to modify classes in JS not PHP, as Magento will serve the cached version of your menu (without "active" classes).
@JacobDrummond
No - we used a custom template BUT this is also present in the Luma theme or standard theme. Did you check it on your system before asking here? I think you would see it.
Attached is a screenshot of the luma theme navigation active class "sale" - you can see this because it is underlined in orange color. If we now activate the caching in the backend and reload the same page the active class is gone --> the caching deactivates the active class --> main bug.
Do you follow me?

@andidhouse, I didn't check a fresh install before asking. Usually these sorts of issues are people not understanding block-level caching.
In your case it looks like a real bug, though :)
@tkacheva not shure why you remove the frontend label here? This is a frontend issue? Can you pls confirm the issue?
@andidhouse Frontent label indicates that it's issue around Frontend framework.
Hello.
Have the same problem with enabled Varnish and nav-menu.
Menu doesn't have any active class for any opened categories, menu looks like as for home page.
Without Varnish everything works ok.
Magento ver. 2.1.2, Varnish-4.0.2
Over 3 month now. Again not fixed in 2.1.3 - reporting bugs makes no sense if they are fixed in years for us....
Any progress with this issue?
Still present in EE 2.1.4
Hey there, any update on this?
Still having the same issue in CE 2.1.7
@andidhouse, thank you for your report.
The issue is already fixed in 2.2.1
Hello.
Magento 2.1.7
I am currently experience this issue with LiteSpeed server +LiteMage Cache and LiteMage Cache for Magento extension.
Can anyone point me to the fix in 2.2.1 so I can apply a path to my version please?
Thanks.
Juliano
Currently running 2.2.2 with Varnish and still having this issue.
With FPC disabled the menu works fine.
I'm having the same issue in Magento 2.2.2 with Varnish and Nginx. Can't solve when cache is enabled.
But with Apache 2 in other server it is not happening.
Any light on this?
Having similar issue in 2.2.2 (Varnish + Nginx) . Menu doesn't display on homepage + no active classes
I tried to use -p feature=+esi_ignore_https in Varnish, but it didn't solved the issue, which as @Yasp0 wrote appears when FPC is enabled.
My issue was related to a custom module that was throwing a 500 error in the Ajax response. Disabled the module for now and everything works as expected.
I am experiencing the exact opposite issue. When I have cache disabled the top menu navigation works as expected (no duplicate active categories). But as soon as I enable cache, the top menu starts showing multiple active categories. Basically if you browse to one category then select another category they will both show as active. Or if you head to the homepage, one of the categories will remain active.
Same issue as @trucatchtraps. Fresh CE 2.3.2 installation using Luma.
@fr33ztyl3 I found a solution and I added the complete fix on this stackexchange question. The original poster figured out the solution, I just simplified it and made it easy to create the entire custom module.
I tried to use -p feature=+esi_ignore_https in Varnish, but it didn't solve the issue, which as @Yasp0 wrote appears when FPC is enabled.
I was wrong
I'm actually convinced that the solution is -p feature=+esi_ignore_https in Varnish file. I tried to apply it for the first time didn't work, but them I followed steps describe here: https://pt.slideshare.net/TonyBrown44/magento-2-and-avoiding-the-rabbit-hole
And It worked.
Most helpful comment
I am experiencing the exact opposite issue. When I have cache disabled the top menu navigation works as expected (no duplicate active categories). But as soon as I enable cache, the top menu starts showing multiple active categories. Basically if you browse to one category then select another category they will both show as active. Or if you head to the homepage, one of the categories will remain active.