The menu is broken after upgrade to Drupal 10 and 5.0.0-alpha1

Created on 16 February 2024, 9 months ago
Updated 22 March 2024, 8 months ago

Problem/Motivation

After upgrading Drupal to version 10 and the Responsive Menu module to version 5.0.0-alpha1, the menu styles don't load correctly.

It happens because the module tries to load `libraries/mmenu/dist/mmenu.css` but this file got removed on this version - apparently, replaced by jquery.mmenu.css

Console log:
Refused to apply style from 'https://site.local.com/libraries/mmenu/dist/mmenu.css?s8yiwj' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

At `responsive_menu.libraries.yml` we can see the responsive_menu.mmenu library calling the mmenu.css and mmenu.js
Comparing the files at menu/dist/ it's clear that the mmenu files were replaced, but the library was not updated. See screenshots attached

Steps to reproduce

  • Install a Drupal 10 vanilla site
  • Install and enable the Responsive Menu module (version 5.0.0-alpha1)
  • Configure the module
  • Create a menu
  • The style is broken

Proposed resolution

Update the code that was pointing to mmenu.css and mmenu.js, so it finds the correct files.
It doesn't seem to be a matter of updating the library to find jquery.mmenu.css instead of mmenu.css. I tried that, but it didn't work.

🐛 Bug report
Status

Active

Version

5.0

Component

Code

Created by

🇧🇷Brazil irafah

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

Comments & Activities

  • Issue created by @irafah
  • 🇧🇷Brazil irafah

    This issue can be closed. It was more related to custom code than contrib/core.
    We started by adding drupal/once to the dependencies and replacing jquery once with Drupal once. The rest was custom code.

    Thanks!

Production build 0.71.5 2024