webpack-dev-server crashes on webpack compilation

Created on 16 Feb 2018  路  3Comments  路  Source: webpack/webpack-dev-server

  • Operating System: Windows 10
  • Node Version: 8.1.4
  • NPM Version: 5.5.1
  • webpack Version: 4.0.0-beta.1
  • webpack-dev-server Version: 3.0.0-alpha6

  • [X] This is a bug

  • [ ] This is a modification request

Code

const path = require('path');

const production = process.env.NODE_ENV === 'production';
const appPath = path.resolve(__dirname, 'src');
const distPath = path.resolve(__dirname, 'dist');

module.exports = {
  entry: appPath,
  mode: 'development',
  output: {
    filename: '[name].js',
    path: distPath
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: 'babel-loader'
      }
    ]
  }
};

Running with webpack-dev-server

Expected Behavior

webpack-dev-server reloads the page with the new changes.

Actual Behavior

webpack-dev-server sometimes crashes with the following error:

events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:1022:11)
    at TCP.onread (net.js:610:25)

For Bugs; How can we reproduce the behavior?

Create a webpack config (on development mode), run webpack-dev-server, make some changes, save and wait for webpack to bundle your assets.

Most helpful comment

Please try [email protected] which reverted some of the changes made in [email protected]*, this should not happen anymore now

All 3 comments

Please try [email protected] which reverted some of the changes made in [email protected]*, this should not happen anymore now

Using [email protected] also solved the following issue:

node_modules\webpack-dev-server\lib\cli\util.js:51
      log();
      ^

TypeError: log is not a function
    at ready (D:\Workspace\Github\scarlett-blast\node_modules\webpack-dev-server\lib\cli\util.js:51:7)
    at Server.devServer.listen (D:\Workspace\Github\scarlett-blast\node_modules\webpack-dev-server\lib\cli\start.js:61:7)
    at Server.returnValue.server.listen (D:\Workspace\Github\scarlett-blast\node_modules\webpack-dev-server\lib\DevServer.js:179:18)
    at Object.onceWrapper (events.js:314:30)
    at emitNone (events.js:110:20)
    at Server.emit (events.js:207:7)
    at emitListeningNT (net.js:1371:10)
    at _combinedTickCallback (internal/process/next_tick.js:135:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Updating to ^3.0.0-beta.1 fixed the issue! Thanks :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mischkl picture mischkl  路  3Comments

Jack-Works picture Jack-Works  路  3Comments

hnqlvs picture hnqlvs  路  3Comments

antoinerousseau picture antoinerousseau  路  3Comments

StephanBijzitter picture StephanBijzitter  路  3Comments