MenuActiveTrail ($menu_link_manager) must be of type Menu\MenuLinkManagerInterface, DependencyInjection\Container given

Created on 23 November 2023, about 1 year ago
Updated 28 February 2024, 10 months ago

Problem/Motivation

After upgrading to 10.2.0-beta1 from the latest 10.1.6, we're encountering the following error on any page load:

Uncaught PHP Exception TypeError: "Drupal\\Core\\Menu\\MenuActiveTrail::__construct(): Argument #1 ($menu_link_manager) must be of type Drupal\\Core\\Menu\\MenuLinkManagerInterface, Drupal\\Core\\DependencyInjection\\Container given, called in /core/lib/Drupal/Component/DependencyInjection/Container.php on line 259" at /core/lib/Drupal/Core/Menu/MenuActiveTrail.php line 44

This does not occur on 10.2.0-alpha1.

Steps to reproduce

Upgrade to 10.2.0-beta1, attempt to access any page.

Proposed resolution

The change made in 📌 Convert both BookNavigationCacheContext and MenuActiveTrailsCacheContext to use lazy services RTBC appears to have caused this, removing lazy: true from menu.active_trail resolves the issue, but defeats the purpose of the change.

🐛 Bug report
Status

Closed: outdated

Version

11.0 🔥

Component
Menu system 

Last updated about 20 hours ago

Created by

🇬🇧United Kingdom Hephaestus

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024