ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Error getting IPv4 address: TypeError: String.prototype.small called on null or undefined (CLI v2.0.0-beta.25)

Open jgw96 opened this issue 10 years ago • 13 comments

From @sava999 on May 5, 2016 20:47

Short description of the problem:

ionic run android --livereload is not working. Next error shows:

Setup Live Reload

Multiple addresses available.
Please select which address to use by entering its number from the list below:


Error getting IPv4 address: TypeError: String.prototype.small called on null or undefined (CLI v2.0.0-beta.25)

Your system information:

Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.6
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Distributor ID: LinuxMint Description:  Linux Mint 17.3 Rosa 
Node Version: v5.11.0

Please note that same error is happening on Windows:

Setup Live Reload

Multiple addresses available.
Please select which address to use by entering its number from the list below:


Error getting IPv4 address: TypeError: String.prototype.small called on null or undefined (CLI v2.0.0-beta.25)

Your system information:

Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Windows 7 SP1
Node Version: v4.4.3

What behavior are you expecting?

I think that is clear.

Steps to reproduce:

  1. Run ionic run android --livereload

Which Ionic Version? 2.x


Anyone else experiencing this issue?

Thanks!

Copied from original issue: driftyco/ionic#6452

jgw96 avatar May 06 '16 14:05 jgw96

From @davidhoeck on May 5, 2016 22:4

+1

jgw96 avatar May 06 '16 14:05 jgw96

From @MisterDev on May 6, 2016 13:16

+1

Cordova CLI: 6.1.1
Ionic Framework Version: 1.1.0
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Mac OS X El Capitan
Node Version: v6.0.0

jgw96 avatar May 06 '16 14:05 jgw96

Hello all! Thanks for opening an issue with us! Since this issue is more related to the ionic-cli and not the Ionic frameowork I will be moving this issue there.

jgw96 avatar May 06 '16 14:05 jgw96

+1

dbertels avatar May 08 '16 01:05 dbertels

+1!!

ggardiles avatar May 08 '16 22:05 ggardiles

A possible workaround: (I tested it for Android)

The trick is to share internet connection from my device (connected to the wifi) to my PC through USB.

It is able to find the address and livereload works as expected. It works well for me at least until this problem gets fixed.

Make sure to add the Content security policy:

<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">

The whitelist plugin and the settings to config.xml:

<content src="index.html"/>
  <access origin="*"/>
  <allow-navigation href="*"/>

Your system information:

Cordova CLI: 6.1.1 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.6 Ionic CLI Version: 2.0.0-beta.25 Ionic App Lib Version: 2.0.0-beta.15 OS: Windows 8.1 Node Version: v4.1.0

ggardiles avatar May 08 '16 23:05 ggardiles

@ggardiles thanks for hint. For now I downgraded CLI to 2.0.0-beta.23 where this works as expected.

sava999 avatar May 09 '16 09:05 sava999

Same error for iOS too: screen shot 2016-05-10 at 10 39 37

nunoarruda avatar May 09 '16 22:05 nunoarruda

Downgrading to beta.23 seems to alleviate it... just run npm install -g [email protected]

rosdi avatar May 10 '16 23:05 rosdi

Another workaround is to alternate between Node versions (worked for me):

  1. nvm use 6.1.0
  2. ionic run android --livereload
  3. Choose the IP address, then quit the server
  4. nvm use 5.1.1
  5. ionic run android --livereload

Rationale:

  • with Node 6.1.0 I can see the IP addresses and choose the right one, but building/livereloading doesn't work (I get ✗ (node:4126) fs: re-evaluating native module sources is not supported.)
  • with Node 5.1.1 I can have live-reloading but not IP address choosing

egueli avatar May 11 '16 08:05 egueli

+1

Cordova CLI: 6.1.1
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.3 
ios-sim version: 5.0.4 
OS: Mac OS X El Capitan
Node Version: v5.12.0
Xcode version: Xcode 7.3 Build version 7D175 

tamerbak avatar Jul 27 '16 10:07 tamerbak

This solution worked for me. I'm using Genymotion emulator, and I had to add --address [Virtualbox_address]

tamerbak avatar Jul 27 '16 10:07 tamerbak

This issue has been automatically closed because it had the v2 label. Please install the new CLI v3 (npm install -g ionic@latest). See CHANGELOG.md#Upgrading from CLI v2 for details.

If this issue is still a problem in CLI v3, please create a new issue. Thank you!

imhoffd avatar Jul 28 '17 22:07 imhoffd