Meena Mana
Meena Mana

Reputation: 249

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?

Upvotes: 3

Views: 5866

Answers (2)

sree
sree

Reputation: 3193

I’ve found a solution by deleting the webpack folder in @ngtools. This solution worked for me.

Upvotes: 4

Meena Mana
Meena Mana

Reputation: 249

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

Upvotes: 0

Related Questions