question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

isMobile.xxxxx on v1.0.2 returns undefined.

  • isMobile.any
  • isMobile.phone
  • isMobile.tablet

And isMobile.xxxxx.xxxxx returns following error.

Uncaught TypeError: Cannot read property 'phone' of undefined
  • isMobile.apple.phone
  • isMobile.apple.ipod
  • isMobile.apple.tablet
  • isMobile.apple.device (any mobile Apple device)
  • isMobile.android.phone
  • isMobile.android.tablet
  • isMobile.android.device (any mobile Android device; OkHttp user agents will match this)
  • isMobile.amazon.phone
  • isMobile.amazon.tablet
  • isMobile.amazon.device (any mobile Amazon Silk device)
  • isMobile.windows.phone
  • isMobile.windows.tablet
  • isMobile.windows.device (any mobile Windows device)
  • isMobile.other.blackberry_10
  • isMobile.other.blackberry
  • isMobile.other.opera (Opera Mini)
  • isMobile.other.firefox
  • isMobile.other.chrome
  • isMobile.other.device (any “Other” device)

Related #94

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kaimalleacommented, Aug 20, 2019

Great, I’ll close this and assign an issue to myself to update the README to document this, and other use cases, so usage is clearer. In this case, when used as a module you are given the opportunity to pass in your own useragent string and so you must execute it yourself.

0reactions
sectsectcommented, Aug 20, 2019

@kaimallea

isMobile() returns correct object.

import isMobile from 'ismobilejs';

export default () => {
  console.log(isMobile());
};

Return

{
    "apple": {
        "phone": true,
        "ipod": false,
        "tablet": false,
        "device": true
    },
    "amazon": {
        "phone": false,
        "tablet": false,
        "device": false
    },
    "android": {
        "phone": false,
        "tablet": false,
        "device": false
    },
    "windows": {
        "phone": false,
        "tablet": false,
        "device": false
    },
    "other": {
        "blackberry": false,
        "blackberry10": false,
        "opera": false,
        "firefox": false,
        "chrome": false,
        "device": false
    },
    "any": true,
    "phone": true,
    "tablet": false
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

yarn test error on v1.0.2 tag · Issue #236 · Uniswap/v3-staker · GitHub
An unexpected error occurred: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash ( ...
Read more >
Make error - v1.0.2 - RT Users - Request Tracker Community Forum
Hi, I'm attempting to install rt-1.0.2 and I'm getting an error in the makefile. I've edited all the proper variables, and have them...
Read more >
Error updating WN3000RP-V1.0.2.64_1.1.86 firmware
Trying to update my Wifi extender firmware to the latest WN3000RP-V1.0.2.64_1.1.86 firmware Downloaded the firmware; Connected my PC via ...
Read more >
Product 'c2000ware_software_package' v1.0.2.00 is ... - TI E2E
I get the following error when I try to build my project: Buildfile generation error occurred.. Product 'c2000ware_software_package' v1.0.2.00 ...
Read more >
Error | @twilio/live-player-sdk - v1.0.2
Documentation for @twilio/live-player-sdk - v1.0.2. ... Telemetry data indicating that a Player experienced an error while connecting to a live stream.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found