Skip to content

TypeError: this.hostname.indexOf is not a function #1109

Closed

Description

@penggy
  • Operating System: Windows7
  • Node Version: 6.10.0
  • NPM Version: 5.3.0
  • webpack Version: 3.5.3
  • webpack-dev-server Version: 2.8.2
  • This is a feature request
  • This is a bug

devServer config

    devServer: {
        host: '0.0.0.0',
        useLocalIp: true,
        open: true,
        openPage: "",
        proxy: {
            "*": {
                target: 'http://localhost:10011/',
                secure: false
            }
        }
    }

the error report

image

I found this at version 2.8.2 and then found webpack-dev-server version > 2.7.1 have this problem.

Now, I rollback to 2.7.1 , it works fine.

Activity

  1. shellscape commented on Sep 20, 2017

    @shellscape
    Contributor

    @penggy what's the command you're using to launch webpack-dev-server from the command line?

  2. penggy commented on Sep 21, 2017

    @penggy
    Author

    @shellscape the command is

    npm run start

    the script in package.json is

    "start": "cross-env NODE_ENV=development webpack-dev-server"

    if set useLocalIp: false error info disappear

  3. shellscape commented on Sep 21, 2017

    @shellscape
    Contributor

    This is another errant package update from the cleanup effort I'm afraid. We definitely need some better testing around the different options. I'll push a commit to change the internal-ip dependency back to 1.2.0, which is the module update that broke this option.

  4. paztis commented on Sep 22, 2017

    @paztis

    In version 1.2.0, internalIp.v4() was returning the ip.
    In version 2.0.0, internalIp.v4() returns a Promise. That's not the same at all.

    It fails during: const hostname = options.useLocalIp ? internalIp.v4() : options.host; in createDomain.js.

    Is it possible to publish the version with the fix (rollback to 1.2.0 or correction of the Promise management)

  5. shellscape commented on Sep 25, 2017

    @shellscape
    Contributor

    @paztis much appreciate the extra hand there, but per previous comments and the referenced commit in the issue, we identified the issue with this and there has been a commit pushed. versions are released when we're able to. please feel free to reference the git repo directly in your package.json in the meantime

  6. shellscape commented on Sep 26, 2017

    @shellscape
    Contributor

    @infantito please avoid posting "me too" or "same" replies on an issue, especially once it's been addressed. instead, you can add reactions to the original post for the issue https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions