johnagan / clean-webpack-plugin

A webpack plugin to remove your build folder(s) before building
MIT License
1.96k stars 135 forks source link

_this.paths.forEach is not a function #130

Closed mhavci closed 5 years ago

mhavci commented 5 years ago
 new CleanWebpackPlugin({
      verbose: isDev
    }),

devServer: {
    writeToDisk: true,
    disableHostCheck: true,
    https: false,
    contentBase: paths.outputPath,
    hot: true,
    quiet: false,
    noInfo: false,
    compress: true,
    stats: {
      colors: true
    },
    lazy: false,
    historyApiFallback: {
      disableDotRule: true
    },
    inline: true,
    watchContentBase: true,
    host: process.env._HOST,
    port: process.env._PORT,
    headers: { 'Access-Control-Allow-Origin': '*' }
  },
TypeError: _this.paths.forEach is not a function
    at CleanWebpackPlugin.clean (C:\workspace\OLEY_NEW\oley-web-new\oley-web-app\node_modules\clean-webpack-plugin\index.js:92:15)
    at CleanWebpackPlugin.apply (C:\workspace\OLEY_NEW\oley-web-new\oley-web-app\node_modules\clean-webpack-plugin\index.js:212:20)
    at webpack (C:\workspace\OLEY_NEW\oley-web-new\oley-web-app\node_modules\webpack\lib\webpack.js:47:13)
    at startDevServer (C:\workspace\OLEY_NEW\oley-web-new\oley-web-app\node_modules\webpack-dev-server\bin\webpack-dev-server.js:145:16)
    at processOptions (C:\workspace\OLEY_NEW\oley-web-new\oley-web-app\node_modules\webpack-dev-server\bin\webpack-dev-server.js:136:3)
    at Object.<anonymous> (C:\workspace\OLEY_NEW\oley-web-new\oley-web-app\node_modules\webpack-dev-server\bin\webpack-dev-server.js:251:1)
    at Module._compile (internal/modules/cjs/loader.js:723:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:776:12)
    at executeUserCode (internal/bootstrap/node.js:342:17)
    at startExecution (internal/bootstrap/node.js:276:5)
chrisblossom commented 5 years ago

I suspect you are still using clean-webpack-plugin < v2. If so, update to v2 (recommended) or read the v1 docs. Otherwise please provide a minimal reproducible repository.

Run: npx envinfo --system --binaries --npmPackages clean-webpack-plugin,webpack

Also, next time when filling out an issue please follow the issue template.

chrisblossom commented 5 years ago

Please reopen if you are still experiencing issues.