Skip to content
Latchkey

Webpack "configuration has an unknown property" schema error in CI

Webpack validates the config object against its schema before building. An option that does not exist (or moved between major versions) fails that check, so Webpack rejects the config before compiling anything.

What this error means

The build stops immediately with "Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema" and names the unknown property.

webpack
Invalid configuration object. Webpack has been initialised using a configuration
object that does not match the API schema.
 - configuration has an unknown property 'loaders'. These properties are valid:
   object { amd?, bail?, cache?, ..., module?, ... }

Common causes

An option from a different Webpack major

Keys like module.loaders or resolve.root were valid in older Webpack and removed later; the installed major no longer accepts them.

A typo or misplaced key

A property nested under the wrong object, or simply misspelled, does not match the schema and is reported as unknown.

How to fix it

Move the option to its current name

  1. Read which property the schema flags and where it belongs.
  2. Rename or relocate it to the key the installed Webpack expects.
  3. Re-run the build to pass schema validation.
webpack.config.js
// Webpack 5: module.loaders -> module.rules
module: {
  rules: [{ test: /\.js$/, use: 'babel-loader' }],
}

Check the schema list in the error

The error prints the valid properties for that object. Match your key against that list to find the correct name.

How to prevent it

  • Follow the migration guide when bumping Webpack majors.
  • Validate config changes locally before pushing.
  • Keep config keys aligned with the installed Webpack version.

Frequently asked questions

What causes ""configuration has an unknown property""?
Keys like module.loaders or resolve.root were valid in older Webpack and removed later; the installed major no longer accepts them.
How do I fix "configuration has an unknown property"?
Move the option to its current name

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card