Giter Club home page Giter Club logo

Comments (5)

netmikey avatar netmikey commented on August 21, 2024

Did you update your composer dependencies using composer update on your server after adding the bundle? Also, you might need to clear some caches in production environment bin/console cache:clear, etc...

from mobiledetectbundle.

mllull avatar mllull commented on August 21, 2024

Yes, I've updatet my composer and I cleaned my cache. Few minutes ago I've reinstalled the bundle, but it is giving me the same error.

P.S: I'm on Nginx, but theoretically this should not affect.

from mobiledetectbundle.

mllull avatar mllull commented on August 21, 2024

Well guys, I finally solved the problem.

I changed the method to import MobileDetector. I put this code on top of the file:

use SunCat\MobileDetectBundle\DeviceDetector\MobileDetector;

and in the function:

$mobileDetector = new MobileDetector();

And that's all! Problem solved.

from mobiledetectbundle.

netmikey avatar netmikey commented on August 21, 2024

Well, by manually instantiating MobileDetector, you're not using the service container...

Is the bundle being loaded in AppKernel without environment condition?

You might try bin/console container:debug in your production environment (be sure you're using the prod environment on your CLI) and see whether mobile_detect.mobile_detector is present or not. If it's not, you're obviously not loading the bundle.

Hope that helps :)

from mobiledetectbundle.

mllull avatar mllull commented on August 21, 2024

Yes, it's present in container:debug. I don't know the problem with my installation, but anyway, now it works!

from mobiledetectbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.