Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Watch Ignore Plugin has been initialized using an options object that does not match the API schema

Webpack: Starting ...
ui/node_modules/schema-utils/dist/validate.js:104
    throw new _ValidationError.default(errors, schema, configuration);
    ^

ValidationError: Invalid options object. Watch Ignore Plugin has been initialized using an options object that does not match the API schema. {
  schema: {
    title: 'WatchIgnorePluginOptions',
    type: 'object',
    additionalProperties: false,
    properties: {
      paths: {
        description: 'A list of RegExps or absolute paths to directories or files that should be ignored.',
        type: 'array',
        items: {
          description: 'RegExp or absolute path to directories or files that should be ignored.',
          anyOf: [ [Object], [Object] ]
        },
        minItems: 1
      }
    },
    required: [ 'paths' ]
  },
  headerName: 'Watch Ignore Plugin',
  baseDataPath: 'options',
  postFormatter: null
}

It is thrown with the following configuration:

new webpack.WatchIgnorePlugin([ 'src/test' ])

The version of webpack is "^5.0.0-rc.6". According to constructor

constructor(paths: Array<string | RegExp>)

[ 'src/test' ] should be fine. Where I did a mistake?

like image 712
NameAlex Avatar asked Oct 16 '25 06:10

NameAlex


1 Answers

I got the answer from this issue.

The WatchIgnorePlugin options should be converted to

new webpack.WatchIgnorePlugin({paths: [ 'src/test' ]})
like image 162
Yogesh Tiwari Avatar answered Oct 19 '25 01:10

Yogesh Tiwari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!