Dll Reference Plugin Invalid Options after upgrade from 4.19.1

Bug report

What is the current behavior?
After upgrading from 4.19.1 to 4.20.(0|1) I receive a long list of validation errors (estimate over 1000) when trying to reference a DLL bundle with the DLL Reference Plugin. These errors start with

[my project]\node_modules\schema-utils\src\validateOptions.js:31
    throw new ValidationError(ajv.errors, name);
    ^

ValidationError: Dll Reference Plugin Invalid Options

options.manifest.content['./node_modules/@babel/runtime/helpers/interopRequireDefault.js']['meta'] is an invalid additional property

and end with

options.manifest.content should match some schema in anyOf
options.manifest should be string
options.manifest should match exactly one schema in oneOf
options['manifest'] is an invalid additional property
options.content is a required property
options.name is a required property
options should match some schema in anyOf

    at validateOptions ([my project]\node_modules\schema-utils\src\validateOptions.js:31:11)
    [stack trace continues...]

The DLL bundle was created with a separate project using Webpack 3.10.0. I don’t think this matters but if it does then I’m happy to not consider this a bug and make due with 4.19.1 to retain backwards compatibility.

My DLL Reference Plugin options look like this

    new webpack.DllReferencePlugin({
        context: __dirname,
        manifest: require('./node_modules/[path to manifest.json file]')
    }),

If the current behavior is a bug, please provide the steps to reproduce.
Create a DLL bundle with the options above and then try to reference it with the DLL Reference Plugin using Webpack 4.20.(0|1).

What is the expected behavior?
I expect this to build without the validation errors as it did in Webpack 4.19.1.

Other relevant information:
webpack version: 4.20.(0|1)
Node.js version: 10.1.0
Operating System: Windows 10
Additional tools: DLL Plugin/DLL Reference Plugin

Author: Fantashit

1 thought on “Dll Reference Plugin Invalid Options after upgrade from 4.19.1

  1. Ran across this issue while trying to upgrade a .NET SPA app from Webpack 2.x to 4.x. In my case, webpack.config.js was using the DLL Reference Plugin for the vendor libraries:

    plugins: [
    	new webpack.DllReferencePlugin({
    		context: __dirname,
    		manifest: require('./ClientApp/dist/vendor-manifest.json'),
    		sourceType: 'commonjs2',
    		name: './vendor'
    	})
    ]
    

    The vendor-manifest.json file was what was causing the “Dll Reference Plugin Invalid Options” error, and after looking through the .NET SPA app’s webpack.config files, found that json file was being built by webpack.config.vendor.js.

    Simply running webpack --config webpack.config.vendor.js with the latest webpack-cli rebuilt vendor-manifest.json (the DLL), and allowed me to get past the error.

Comments are closed.