Skip to content

IgnorePluginOptions error while building functions: vertx #562

@DavidSabine

Description

@DavidSabine

While building functions for use with a Gatsby site, I've been hitting this error for months.

CLI Output

netlify-lambda: Building functions
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.
    at validate (C:\Users\me\Documents\GitHub\my-site\node_modules\schema-utils\dist\validate.js:105:11)
    at C:\Users\me\Documents\GitHub\my-site\node_modules\webpack\lib\util\create-schema-validation.js:16:17
    at new IgnorePlugin (C:\Users\me\Documents\GitHub\my-site\node_modules\webpack\lib\IgnorePlugin.js:28:3)
    at webpackConfig (C:\Users\me\Documents\GitHub\my-site\node_modules\netlify-lambda\lib\build.js:161:7)
    at async Object.exports.run (C:\Users\me\Documents\GitHub\my-site\node_modules\netlify-lambda\lib\build.js:208:18) {
  errors: [
    {
      keyword: 'anyOf',
      dataPath: '',
      schemaPath: '#/anyOf',
      params: {},
      message: 'should match some schema in anyOf',
      schema: [Array],
      parentSchema: [Object],
      data: /vertx/,
      children: [Array]
    }
  ],
  schema: { title: 'IgnorePluginOptions', anyOf: [ [Object], [Object] ] },
  headerName: 'Ignore Plugin',
  baseDataPath: 'options',
  postFormatter: null
}

To Reproduce

I don't know how to reproduce the error. I don't use "vertx" in the project and have no idea what it is.

To Avoid the error

  1. I navigate to my node_modules/netlify-lambda/lib/build.js > webpackConfig > webpackConfig > plugins
  2. And delete this line:
new webpack.IgnorePlugin(/vertx/),

Then all is well!

Configuration

netlify.toml

[build]
	functions = './site/__functions__'

[dev]
	autoLaunch = false
	command = 'yarn workspace site develop'
	framework = '#custom'
	port = 8888
	publish = './site/public'
	targetPort = 8000

[[plugins]]
	package = 'netlify-plugin-gatsby-cache'
  • Please enter the following command in a terminal and copy/paste its output:

npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli

  System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 19.26 GB / 31.96 GB
  Binaries:
    Node: 14.16.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 3.1.1 - C:\Program Files\nodejs\yarn.CMD
    npm: 6.14.12 - C:\Program Files\nodejs\npm.CMD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions