Skip to content

Passing an hostname to --address doesn't work after version 3.15.2 #3557

Description

@giorgio-cara

Description:
Up until version 3.15.2 included, when I pass a resolvable hostname using the option --address the browser automatically opens with that hostname in the URL. In newer versions the browser opens always with "localhost" in the URL.

Steps to Reproduce:

  1. configure a hostname that resolves to 127.0.0.1 in the hosts file, let's call it "myhostname" in this example
  2. install ionic CLI 3.15.2 with the command "npm i -g ionic@3.15.2"
  3. run the command "ionic serve --address myhostname", the browser opens using "myhostname" in the URL
  4. update the CLI to one of the next versions (version 4 included), for example with the command "npm i -g ionic@3.16.0"
  5. run the command "ionic serve --address myhostname", now the browser opens using "localhost" in the URL instead of "myhostname"

My ionic info:

cli packages: (C:\Users\giorg\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.16.0
    ionic (Ionic CLI) : 3.16.0

local packages:

    @ionic/app-scripts : 3.1.11
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.11.3
    npm  : 5.6.0
    OS   : Windows 10

Misc:

    backend : legacy

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions