Skip to content

fix: resolve npm peer dependency conflicts#323

Open
LayaTaal wants to merge 2 commits intomainfrom
fix/npm-peer-dependency-conflict
Open

fix: resolve npm peer dependency conflicts#323
LayaTaal wants to merge 2 commits intomainfrom
fix/npm-peer-dependency-conflict

Conversation

@LayaTaal
Copy link
Copy Markdown
Contributor

@LayaTaal LayaTaal commented Feb 25, 2026

Summary

  • Adds overrides block to package.json to pin react and react-dom to ^18.0.0, preventing npm from resolving React 19 (via @dnd-kit's loose >=16.8.0 peer dep) which conflicts with @wordpress/icons and @wordpress/scripts
  • Ported from nexcess-2026#8

Test plan

  • Delete node_modules and package-lock.json, then run npm install — should complete without errors
  • Run npm run build to verify blocks compile successfully

🤖 Generated with Claude Code

Add overrides to pin react/react-dom to ^18.0.0 to prevent npm
from resolving React 19 (via @dnd-kit's loose >=16.8.0 peer dep),
which conflicts with @wordpress/icons and @wordpress/scripts requiring
react@^18.0.0. Also pins minimatch to 5.1.8 to avoid a yanked 5.1.9
tarball that breaks fresh installs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LayaTaal LayaTaal self-assigned this Feb 25, 2026
@LayaTaal
Copy link
Copy Markdown
Contributor Author

@dpellenwood @GeoffDusome I ran into this issue on the Nexcess site when trying to install fresh dependencies. NPM wants to automatically go to React 19 which is causing issues with the WordPress icon library peer dependency requirement.

I'm not sure why the extra minimatch override was originally included, but I have removed that without issue.

@dpellenwood
Copy link
Copy Markdown
Collaborator

dpellenwood commented Feb 25, 2026

@dpellenwood @GeoffDusome I ran into this issue on the Nexcess site when trying to install fresh dependencies. NPM wants to automatically go to React 19 which is causing issues with the WordPress icon library peer dependency requirement.

I'm not sure why the extra minimatch override was originally included, but I have removed that without issue.

Note that this issue is only applicable if there is not a package-lock.json file present. I was able to get around this by running npm i --legacy-peer-deps and then any subsequent npm install runs are fine. I'm not sure I want to commit this to the project right away. I would like to see if we can give it a bit of time so that all our deps can bump to React 19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants