configuration.module has an unknown property 'loaders'

You should change loaders to rules in webpack 4:

change:

loaders 

to:

rules

source: Loaders

Example:

module.exports = {
  module: {
    rules: [
      { test: /\.css$/, use: 'css-loader' },
      { test: /\.ts$/, use: 'ts-loader' }
    ]
  }
};

Use rules in webpack 4 instead of loaders.

https://webpack.js.org/concepts/loaders/


You should use the migration utility to migrate your webpack config files, it worked for me.

The migration documentation is also useful.


Above given answers are working but we can resolve this issue by changing webpack and webpack-dev-server version to

"webpack": "3.8.1",
"webpack-dev-server": "2.9.4"

It can also solve the issue. Hope it will help.