10/05/2016

Unable to Access Localhost when running Webpack Dev Server

Question


In my sample React JS project I have a file called "webpack.config.js" and in it I specified the port where to run my localhost to 6000. My "webpack.config.js" looks like this:

When I try to run the webpack-dev-server it gives me the page "This site can't be reached".

Unable to Access Localhost when running Webpack Dev Server
Unable to Access Localhost when running Webpack Dev Server
Answer

I have encountered this issue as well and the cause of it is the port (in my experience). Granting the fact that you have setup everything properly (from react files, javascript files to node modules), something somewhere in your PC is already using the port 6000 so all you need to do is change the port to something else and it should work.