Search code examples
angularwebpack-dev-serverangular4-httpclient

Webpack-dev-server- Module build failed


I am getting the error

---Error is below

 ERROR in ./src/main.ts
Module build failed: [object Object]
 @ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
ERROR in ./src/polyfills.ts
Module build failed: [object Object]
 @ multi ./src/polyfills.ts

Below is my webpack.config.js

module.exports = {
    devServer: {
        host: '0.0.0.0',
        disableHostCheck: true
    },
    entry: [
        'webpack-dev-server/client?http://0.0.0.0:4200',
        config.paths.demo
    ]
}

My main.ts and polyfills.ts seem to be all right, I've checked for any errors which there don't seem to be any in those files. My guess is that there is something wrong in my webpack-dev-server.

Does anybody have any suggestions on how to fix this?


Solution

  • I was able to find a solution. I needed to run npm install @angular/cli. After running this command, everything worked perfectly.