Quantcast
Channel: I am getting an "Invalid Host header" message when connecting to webpack-dev-server remotely - Stack Overflow
Viewing all articles
Browse latest Browse all 26

Answer by Eswar Nandam for I am getting an "Invalid Host header" message when connecting to webpack-dev-server remotely

$
0
0

Hello React Developers,

Instead of doing thisdisableHostCheck: true, in webpackDevServer.config.js. You can easily solve 'invalid host headers' error by adding a .env file to you project, add the variables HOST=0.0.0.0 and DANGEROUSLY_DISABLE_HOST_CHECK=true in .env file. If you want to make changes in webpackDevServer.config.js, you need to extract the react-scripts by using 'npm run eject' which is not recommended to do it. So the better solution is adding above mentioned variables in .env file of your project.

Happy Coding :)


Viewing all articles
Browse latest Browse all 26

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>