0

I am getting below Webpack error on a particular machine. on the other machine I am not getting any error & build is sucessful. on both machine we are using Webpack 2.2.1 version.

Error :

Set is not defined 
at Compiler.<anonymous> (/home/../meCommerce-fed/fed-mecommerce/node_modules/copy-webpack-plugin/dist/index.js:83:33)
at Compiler.next (/home/../meCommerce-fed/fed-mecommerce/node_modules/webpack/node_modules/tapable/lib/Tapable.js:69:14)
at /home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/index.js:189:9
at PassThroughHandlerContext.finallyHandler (/home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/finally.js:56:23)
at PassThroughHandlerContext.tryCatcher (/home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/async.js:143:10)
at Async.drainQueues (/home/../meCommerce-fed/fed-mecommerce/node_modules/html-webpack-plugin/node_modules/bluebird/js/release/async.js:17:14)
at process._tickCallback (node.js:415:13)

It's saying Set is not defined on copy-webpack-plugin which is little strange.

Webpack Config:

Note: This is not the entire config file.

var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var CopyWebpackPlugin = require('copy-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var ProvidePlugin = require('webpack/lib/ProvidePlugin');

module.exports = {
  debug: true,
  entry: {
    vendor_angular: ["angular","angular-ui-router","angular-sanitize"],
    bundle: ['./src/app.js'],
  },
  // entry: ['babel-polyfill', './src/app.js'],
  output: {
    path: path.join(__dirname, 'public'),
    filename: '[name].js'
  },
  devServer: {
    // This is required for webpack-dev-server. The path should
    // be an absolute path to your build destination.
    outputPath: path.join(__dirname, 'public')
  },
  plugins: [
    new CopyWebpackPlugin([
      { from: 'src/**/*.js', to: __dirname + '/public' },
      { from: 'src/**/*.png', to: __dirname + '/public' },
      { from: 'src/**/*.svg', to: __dirname + '/public' },
      { from: 'src/**/*.json', to: __dirname + '/public' },
      { from: 'src/**/*.jpg', to: __dirname + '/public' },
      { from: 'src/**/*.mp4', to: __dirname + '/public' },
      { from: 'src/**/*.gif', to: __dirname + '/public' },
      { from: 'src/**/*.wav', to: __dirname + '/public' }
    ]),
    new CleanWebpackPlugin(['public'], {
      root: path.resolve(__dirname),
      verbose: true,
      dry: true
    }),
      ],
  module: {
   },

  devtool: 'source-map'
};

Has anyone encountered similar error. How should I track down what is causing the build to fail.

Samir
  • 691
  • 5
  • 22
  • What is your node version ? – Julien TASSIN Mar 28 '17 at 18:37
  • Node - V6.2.2 & NPM - 3.9.5 – Samir Mar 28 '17 at 18:38
  • OK, very strange you should have Set in node 6 – Julien TASSIN Mar 28 '17 at 18:48
  • What version of `copy-webpack-plugin` are you using? It wouldn't fix the `Set is not defined` directly, but `copy-webpack-plugin` is not using `Set` at all, it has been removed in the commit [82052dd](https://github.com/kevlened/copy-webpack-plugin/commit/82052dd#diff-1fdf421c05c1140f6d71444ea2b27638) (a year ago), which was in v3.0.0 and the latest version published to npm is [v4.0.1](https://www.npmjs.com/package/copy-webpack-plugin). – Michael Jungo Mar 28 '17 at 23:35
  • copy-webpack-plugin : 2.1.6. – Samir Mar 29 '17 at 13:17

0 Answers0