Is your proposal related to a problem?
When fetching the ip address here https://github.com/facebook/create-react-app/blob/a422bf227cf5294a34d68696664e9568a152fd8f/packages/react-dev-utils/WebpackDevServerUtils.js#L46-L60 lanUrlForConfig is set to undefined if the ip address is not private. This results in the error Invalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.allowedHosts[0] should be a non-empty string. I was having a Hamachi server https://www.vpn.net/ open in the background, and it took a long time to figure out that the ip address fetched was the ip address of the hamachi server (starting with 25, i.e. not private).
Describe the solution you'd like
If the error should indeed happen in this case I would like the logging to be improved. Maybe tell the user that the ip is not private, and is what causes the error.
Describe alternatives you've considered
In the start when I encountered the error, I worked around it using the solution stated in https://stackoverflow.com/questions/70374005/invalid-options-object-dev-server-has-been-initialized-using-an-options-object/70491173#70491173 which indeed worked. This was just a bandaid solution however.
Additional context
This is related to #11762 and #11877
Is your proposal related to a problem?
When fetching the ip address here https://github.com/facebook/create-react-app/blob/a422bf227cf5294a34d68696664e9568a152fd8f/packages/react-dev-utils/WebpackDevServerUtils.js#L46-L60
lanUrlForConfigis set toundefinedif the ip address is not private. This results in the errorInvalid options object. Dev Server has been initialized using an options object that does not match the API schema. - options.allowedHosts[0] should be a non-empty string.I was having a Hamachi server https://www.vpn.net/ open in the background, and it took a long time to figure out that the ip address fetched was the ip address of the hamachi server (starting with 25, i.e. not private).Describe the solution you'd like
If the error should indeed happen in this case I would like the logging to be improved. Maybe tell the user that the ip is not private, and is what causes the error.
Describe alternatives you've considered
In the start when I encountered the error, I worked around it using the solution stated in https://stackoverflow.com/questions/70374005/invalid-options-object-dev-server-has-been-initialized-using-an-options-object/70491173#70491173 which indeed worked. This was just a bandaid solution however.
Additional context
This is related to #11762 and #11877