Skip to content

Conversation

@davidfestal
Copy link
Member

Fix webpack version mismatch causing plugin export failure

Problem

plugin export fails when run via npx with:

Error: The 'compilation' argument must be an instance of Compilation

Root Cause

The CLI declares webpack@~5.95.0, but its dependency @backstage/cli@0.34.1 requires webpack@~5.96.0.

When installed via npx, npm/yarn installs both versions:

  • webpack@5.96.x hoisted at root (from @backstage/cli)
  • webpack@5.95.x nested in CLI's node_modules

The @openshift/dynamic-plugin-sdk-webpack plugin (which has webpack as a peer dependency) resolves to the hoisted 5.96.x, while the CLI's bundler uses the nested 5.95.x. This causes webpack's instanceof Compilation check to fail because the Compilation objects come from different webpack instances.

Fix

Align webpack version to ~5.96.0 to match @backstage/cli@0.34.1.

Signed-off-by: David Festal <dfestal@redhat.com>
@davidfestal davidfestal force-pushed the fix-webpack-dependency branch from e518603 to cd03216 Compare January 6, 2026 21:05
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

@nickboldt nickboldt self-requested a review January 6, 2026 21:18
Copy link
Member

@nickboldt nickboldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable.

/lgtm

/make-it-so

/approve

/get-me-that-horizon

@openshift-ci openshift-ci bot added the lgtm label Jan 6, 2026
@davidfestal davidfestal merged commit 6834860 into main Jan 6, 2026
7 checks passed
@davidfestal davidfestal deleted the fix-webpack-dependency branch January 6, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants