Open
Description
Is your proposal related to a problem?
When fetching the ip address here
create-react-app/packages/react-dev-utils/WebpackDevServerUtils.js
Lines 46 to 60 in a422bf2
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.