Error: Class 'Detection\MobileDetect' not found

Created on 24 June 2022, over 2 years ago
Updated 4 January 2024, 9 months ago

Hello,

after updating Drupal Core to 9.4.1 and Mobile detect the following error occured:

The website encountered an unexpected error. Please try again later.
Error: Class 'Detection\MobileDetect' not found in Drupal\Component\DependencyInjection\Container->createService() (line 262 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Drupal\Component\DependencyInjection\Container->createService(Array, 'mobile_detect') (Line: 176)
Drupal\Component\DependencyInjection\Container->get('mobile_detect', 1) (Line: 437)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 240)
Drupal\Component\DependencyInjection\Container->createService(Array, 'mobile_detect.twig.extension') (Line: 176)
Drupal\Component\DependencyInjection\Container->get('mobile_detect.twig.extension', 1) (Line: 437)
Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) (Line: 276)
Drupal\Component\DependencyInjection\Container->createService(Array, 'twig') (Line: 176)
Drupal\Component\DependencyInjection\Container->get('twig') (Line: 197)
Drupal::service('twig') (Line: 47)
...

Can you help me?

best regards

πŸ’¬ Support request
Status

Closed: cannot reproduce

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany sponsch

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.

  • πŸ‡²πŸ‡©Moldova vyck24

    Hi, the same problem!

  • πŸ‡¬πŸ‡§United Kingdom cebab54

    Is anybody actually seriously looking at this?

  • πŸ‡ΊπŸ‡ΈUnited States jsidigital

    I am having the same problem.
    [error] File not found: /home/mysite/public_html/web/modules/contrib/mobile_detect/lib/mobiledetect-mobiledetectlib/v2.8.37/Mobile_Detect.php.

    Anyone find a solution yet?

  • πŸ‡¬πŸ‡§United Kingdom cebab54

    I still have this issue having updated to Version 3.06 and upgraded to Core 10.2.0
    Is anybody seriously looking at this, as you will see above, I am not the only person who has a site with this problem
    Since upgrade today to Core 10.2, this error is being reported over and over again.
    Can somebody please suffest a fix?
    Thank you

  • πŸ‡¬πŸ‡§United Kingdom cebab54

    @NONOM
    The Module has ONLY been installed using Composer, it was a site that was designed and installed as a fresh version of Drupal 8, then upgraded to Drupal 9 and now Drupal 10, ONLY using Composer to install and update the site. I also use DRUSH.

    How do you suggest I resolve this?

    I have already tried uninstalling the module using DRUSH and then removing it with Composer AND then re-installing the module with Composer, BUT the issue still exists

Production build 0.71.5 2024