Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启动时报错:nodejs.ValidationError: Invalid options object. Ignore Plugin has been initialized using an options object that does not match the API schema #175

Open
bravelin opened this issue Feb 15, 2022 · 1 comment

Comments

@bravelin
Copy link

bravelin commented Feb 15, 2022

node version v12.20.0
2022-02-15 16:50:31,243 INFO 8128 [master] egg version 2.33.1
2022-02-15 16:50:32,839 ERROR 11068 nodejs.ValidationError: Invalid options object. Ignore Plugin has been initialized using an options object that does not match the API schema.

  • options should be one of these:
    object { resourceRegExp, contextRegExp? } | object { checkResource }
    Details:
    • options misses the property 'resourceRegExp'. Should be:
      RegExp
      -> A RegExp to test the request against.
    • options misses the property 'checkResource'. Should be:
      function
      -> A filter function for resource and context.
  • options should be one of these:
    object { resourceRegExp, contextRegExp? } | object { checkResource }
    Details:
    • options misses the property 'resourceRegExp'. Should be:
      RegExp
      -> A RegExp to test the request against.
    • options misses the property 'checkResource'. Should be:
      function
      -> A filter function for resource and context.
      at validate (G:\1\packages\egg-vue-webpack-spa-boilerplate\node_modules\webpack\node_modules\schema-utils\dist\validate.js:105:11)
      at G:\1\packages\egg-vue-webpack-spa-boilerplate\node_modules\webpack\lib\util\create-schema-validation.js:16:17
      at new IgnorePlugin (G:\1\packages\egg-vue-webpack-spa-boilerplate\node_modules\webpack\lib\IgnorePlugin.js:28:3)
      at G:\1\packages\egg-vue-webpack-spa-boilerplate\node_modules\easywebpack\lib\core\plugin.js:184:22
      at Array.forEach ()
      at WebpackServerBuilder.createPlugin (G:\1\packages\egg-vue-webpack-spa-boilerplate\node_modules\easywebpack\lib\core\plugin.js:152:26)
      at WebpackServerBuilder.createWebpackPlugin (G:\1\packages\egg-vue-webpack-spa-boilerplate\node_modules\easywebpack\lib\core\plugin.js:217:17)
      at WebpackServerBuilder.combineWebpackConfig (G:\1\packages\egg-vue-webpack-spa-boilerplate\node_modules\easywebpack\lib\target\base.js:143:21)
      at WebpackServerBuilder.create (G:\1\packages\egg-vue-webpack-spa-boilerplate\node_modules\easywebpack\lib\target\base.js:164:17)
      at G:\1\packages\egg-vue-webpack-spa-boilerplate\node_modules\easywebpack\lib\builder.js:168:61
      name: "ValidationError"
      errors: [{"keyword":"anyOf","dataPath":"","schemaPath":"#/anyOf","params":{},"message":"should match some schema in anyOf","schema":[{"type":"object","additionalProperties":false,"properties":{"contextRegExp":{"description":"A RegExp to test the context (directory) against.","instanceof":"RegExp","tsType":"RegExp"},"resourceRegExp":{"description":"A RegExp to test the request against.","instanceof":"RegExp","tsType":"RegExp"}},"required":["resourceRegExp"]},{"type":"object","additionalProperties":false,"properties":{"checkResource":{"description":"A filter function for resource and context.","instanceof":"Function","tsType":"((resource: string, context: string) => boolean)"}},"required":["checkResource"]}],"parentSchema":{"title":"IgnorePluginOptions","anyOf":"0schema"},"data":"/\.(css|less|scss|sass|styl|stylus)$/","children":[{"keyword":"required","dataPath":"","schemaPath":"#/anyOf/0/required","params":{"missingProperty":"resourceRegExp"},"message":"should have required property 'resourceRegExp'","schema":"0schema0properties","parentSchema":"0schema0","data":"/\.(css|less|scss|sass|styl|stylus)$/"},{"keyword":"required","dataPath":"","schemaPath":"#/anyOf/1/required","params":{"missingProperty":"checkResource"},"message":"should have required property 'checkResource'","schema":"0schema1properties","parentSchema":"0schema1","data":"/\.(css|less|scss|sass|styl|stylus)$/"}]}]
      schema: {"title":"IgnorePluginOptions","anyOf":[{"type":"object","additionalProperties":false,"properties":{"contextRegExp":{"description":"A RegExp to test the context (directory) against.","instanceof":"RegExp","tsType":"RegExp"},"resourceRegExp":{"description":"A RegExp to test the request against.","instanceof":"RegExp","tsType":"RegExp"}},"required":["resourceRegExp"]},{"type":"object","additionalProperties":false,"properties":{"checkResource":{"description":"A filter function for resource and context.","instanceof":"Function","tsType":"((resource: string, context: string) => boolean)"}},"required":["checkResource"]}]}
      headerName: "Ignore Plugin"
      baseDataPath: "options"
      postFormatter: null
      message: "Invalid options object. Ignore Plugin has been initialized using an options object that does not match the API schema.\n - options should be one of these:\n object { resourceRegExp, contextRegExp? } | object { checkResource }\n Details:\n * options misses the property 'resourceRegExp'. Should be:\n RegExp\n -> A RegExp to test the request against.\n * options misses the property 'checkResource'. Should be:\n function\n -> A filter function for resource and context."
      pid: 11068
@WinfredWang
Copy link

同上

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants