6

enter image description here

This question relates to post: Keep getting [WDS] Disconnected! error

I have updated my webpack config settings according to the answers, however I still the "[WDS] Disconnected! error" within the console.

Please any suggestions?

webpack.config.js

var webpack = require("webpack");
var path = require("path");


module.exports = {

devtool: "inline-source-map",
entry: [
    "webpack-dev-server/client?http://127.0.0.0:8080/",
    "webpack/hot/only-dev-server",
    "./src"
],
devServer: {
    contentBase: "./public",
    hot: true,    
    inline: true,
    quiet: false,
    noInfo: true,
    stats: { colors: true }
},
output: {
    path: path.join(__dirname, "./public"),
    filename: "./assets/js/bundle.js"
},
resolve: {
    modulesDirectrories: ["node_modules", "src"],
    extentions: ["", ".js"]
},
module : {
    loaders: [
        { 
            test: /\.jsx?$/,
            exclude: "/node_modules/",
            loaders: ["react-hot-loader", "babel?presets[]=react,presets[]=es2015"] 
        }, 
        {
            test: /\.css$/,
            loader: "style-loader!css-loader"
        }, 
        {
            test: /\.gif$/,
            loader: "url-loader?mimetype=image/png"
        }, 
        {
            test: /\.woff(2)?(\?v=[0-9].[0-9].[0-9])?$/,
            loader: "url-loader?mimetype=application/font-woff"
        }, 
        {
            test: /\.(ttf|eot|svg)(\?v=[0-9].[0-9].[0-9])?$/,
            loader: "file-loader?name=[name].[ext]"
        }
    ]
},
plugins: [ 
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin(),
    new webpack.DefinePlugin({
        "process.env": {
            NODE_ENV: JSON.stringify("development")
        }
    })
]}
Community
  • 1
  • 1
vicgoyso
  • 636
  • 1
  • 14
  • 35
  • Can you try `webpack-dev-server/client?localhost:8080/` over `webpack-dev-server/client?http://127.0.0.0:8080/`? Looks like there's a mismatch. I would recommend running webpack-dev-server in `inline` mode to avoid this type of problems. – Juho Vepsäläinen Sep 02 '16 at 16:16
  • Hi Juho, I have tried both paths however I get same error, and as you can see in the code, it already running in inline mode. Thanks – vicgoyso Sep 03 '16 at 07:37
  • You should choose one method instead of using both at the same time. So either set those entries or use the inline mode. – Juho Vepsäläinen Sep 03 '16 at 09:01
  • It worked when I update "module : { loaders: [" to "module : { loader: [" – vicgoyso Sep 10 '16 at 08:35
  • Does this answer your question? [Keep getting \[WDS\] Disconnected! error](https://stackoverflow.com/questions/36917722/keep-getting-wds-disconnected-error) – Michael Freidgeim Sep 07 '21 at 21:30

2 Answers2

2

Change the transportMode to ws instead of "sock-js.node":-

devServer: {
        transportMode: 'ws', 
        injectClient: false,
      }
Mehadi Hassan
  • 1,160
  • 1
  • 13
  • 33
0

This will be solved by Enabling Error Overlay,

overlay:true include one more property in devServer object

devServer: {
    ...
    overlay: true,
}

click here for more info webpack-dev-server

Community
  • 1
  • 1
dipenparmar12
  • 3,042
  • 1
  • 29
  • 39