Run webpack error _ ValidationError2.default (ajv.errors, name)

use plug-in extract-text-webpack-plugin:
package this error after running webpack:
/ Users/apple/work/self_test/webpack/node_modules/schema-utils/dist/validateOptions.js:40

throw new _ValidationError2.default(ajv.errors, name);
^

false

webpack.config,js

//1. webpack
const webpack = require("webpack");
const path = require("path");
// css---
const ExtractTextPlugin = require("extract-text-webpack-plugin")

//2.webpack , 
const commonsPlugin = new webpack.optimize.CommonsChunkPlugin("common.js");

const extractCssPlugin = new ExtractTextPlugin({
    filename:path.resolve(__dirname, "dist/css/[name].css"),
    disabled:process.env.NODE_ENV === "deverlopment"
})
//
module.exports = {
//3.---
plugins: [
        commonsPlugin, 
        extractCssPlugin
    ],

//4.---
entry: {
        test1 : "./js/page1/ab_entry.js",
        test2 : "./js/page2/ey_entry.js",
},

//5.
output: {
path: path.resolve(__dirname, "dist/js"),
filename: "[name].js"
}
,
    //6.---- webpack 
module: {
//npm install XXXnode_module
        rules: [
    { test: /\.css$/, 
                use:ExtractTextPlugin.extract({
                            // use style-loader in deverlopment
                            fallback: "style-loader",
                            use:["css-loader","sass-loader","postcss-loader"]
                            // use:[{loader:"css-loader"},{loader:"sass-loader"},{loader:"postcss-loader"}]
                }),
            }]
},
    
    //7.
resolve: {
root: "E:/github/flux-example/src", //
extensions: ["", ".js", ".json", ".scss"],//require
alias: {//
AppStore : "js/stores/AppStores.js",// require("AppStore") 
ActionType : "js/actions/ActionType.js",
AppAction : "js/actions/AppAction.js"
}
}
};

clipboard.png
maybe your picture path is wrong, just for reference. I encountered exactly the same problem


how did the blogger solve


I encountered this mistake. This is because the configuration of the uglifyjs-webpack-plugin plug-in updates the parameter passing method uglifyoptions


how to solve it, buddy


I have tried, and the 2.1.2 version of extract-text-webpack-plugin will do. 3.x report the above error


extensions: [', '.js', '.json', '.scss']; The null characters in the new version of
will report errors;
will be changed to extensions: ['*', '.js', '.json', '.scss'];


reference:
https://stackoverflow.com/que.
put

 test: /\.scss/, include: SRC_DIR, loader:
          ExtractTextPlugin.extract({ loader: ['css-loader', 'sass-loader'] }) // loader is deprecated
      },

where loader is replaced by use

  test: /\.scss/, include: SRC_DIR, loader:
          ExtractTextPlugin.extract({ use: ['css-loader', 'sass-loader'] }) // use is what I should use. hah
      },

the original loader mode has been abandoned in webpack3


I have encountered the same problem. I have tried all of the above methods and still reported an error.
it turns out that you can comment out the publishPath:'../../', in the utils.js file in the build directory

Menu