Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 2 tasks
penggy opened this issue Sep 20, 2017 · 6 comments
Closed
1 of 2 tasks

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

penggy opened this issue Sep 20, 2017 · 6 comments

Comments

@penggy
Copy link

penggy commented Sep 20, 2017

  • 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.

@shellscape
Copy link
Contributor

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

@penggy
Copy link
Author

penggy commented Sep 21, 2017

@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

@shellscape
Copy link
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.

@paztis
Copy link

paztis commented Sep 22, 2017

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)

@shellscape
Copy link
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

@shellscape
Copy link
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
Projects
None yet
Development

No branches or pull requests

3 participants