Skip to content

webpack@5.106+ validates ProgressPlugin options strictly #41

@webletm

Description

@webletm

Upon running npx mix watch on a fresh install, I get these errors:

[webpack-cli] Invalid options object. Progress Plugin has been initialized using an options object that does not match the API schema.
 - options should be one of these:
   object { activeModules?, dependencies?, dependenciesCount?, entries?, handler?, modules?, modulesCount?, percentBy?, profile? } | function
   Details:
    * options has an unknown property 'name'. These properties are valid:
      object { activeModules?, dependencies?, dependenciesCount?, entries?, handler?, modules?, modulesCount?, percentBy?, profile? }
      -> Options object for the ProgressPlugin.
    * options has an unknown property 'color'. These properties are valid:
      object { activeModules?, dependencies?, dependenciesCount?, entries?, handler?, modules?, modulesCount?, percentBy?, profile? }
      -> Options object for the ProgressPlugin.
    * options has an unknown property 'reporters'. These properties are valid:
      object { activeModules?, dependencies?, dependenciesCount?, entries?, handler?, modules?, modulesCount?, percentBy?, profile? }
      -> Options object for the ProgressPlugin.
    * options has an unknown property 'reporter'. These properties are valid:
      object { activeModules?, dependencies?, dependenciesCount?, entries?, handler?, modules?, modulesCount?, percentBy?, profile? }
      -> Options object for the ProgressPlugin.

webpack@5.106+ validates ProgressPlugin options strictly. webpackbar@5.x (bundled with Laravel Mix 6) extends ProgressPlugin and passes its own options (name, color, reporters, reporter), which webpack now rejects. package.json uses open semver ranges (laravel-mix ^6.0.49), so npm install pulled webpack 5.106.2 and webpackbar 5.0.2 — a combination Laravel Mix 6 wasn’t tested against when the theme was published.

I ended up adding an override:

"overrides": {
    "webpackbar": "^7.0.0"
  },

and then ran npm install to pick up the webpackbar override, then ran npx mix watch and could confirm it compiled without the error.

webpackbar@7 no longer overwrites ProgressPlugin’s options, which resolves the conflict. This is the official workaround for Laravel Mix 6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions