I created an app with create-react-app and the webpack-dev-server uses the react-scripts to load up the dev-server. The problem is i cannot access the dev server via other LAN PC. Any idea how to solve this? I also have a .env file where i change the default HOST name to domain.
I want to access the dev-server via my iPad for example. Earlier i just typed in the IP of the PC and the port and it worked.
I would appreciate any help
I created an app with create-react-app and the webpack-dev-server uses the react-scripts to load up the dev-server. The problem is i cannot access the dev server via other LAN PC. Any idea how to solve this? I also have a .env file where i change the default HOST name to domain..
I want to access the dev-server via my iPad for example. Earlier i just typed in the IP of the PC and the port and it worked.
I would appreciate any help
Share Improve this question asked Feb 5, 2019 at 9:59 Nenad KaevikNenad Kaevik 1751 gold badge4 silver badges20 bronze badges2 Answers
Reset to default 5according to https://webpack.js/configuration/dev-server/#devserverhost just simply by adding
module.exports = {
//...
devServer: {
host: '0.0.0.0'
}
};
or directly via cli
webpack-dev-server --host 0.0.0.0
i have the same problem, i resolve with this: Example IP: 192.168.0.35 'webpack.dev.config.js'
module.exports {
output: {
publicPath: 'http://192.168.0.35:3001/'
},
devServer: {
port: 3001,
host: '192.168.0.35'
}
}