Created by: Manc
This PR fixes issues #12304 and #11762 – “react-scripts start
fails when both HOST
and proxy
are defined”.
proxy
in package.json
of a new project (if verifying within the monorepo code, use packages/react-scripts/package.json
).HOST
environment variable and run the start
script, e.g: HOST=example.local yarn run start
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.
After applying this patch, the script will run as expected, setting the allowedHost
property of the Webpack config to the given hostname.
The function createDevServerConfig
expects the hostname as string for its second argument, but instead of HOST
, urls.lanUrlForConfig
is provided and its value is undefined
.
It appears, this bug has been in introduced all the way back in 2017.
Preferences