Skip to content

fix: resolve npm peer dependency conflict blocking CI#91

Merged
iqbalhasandev merged 8 commits intomainfrom
fix/npm-peer-dep-conflict
Apr 12, 2026
Merged

fix: resolve npm peer dependency conflict blocking CI#91
iqbalhasandev merged 8 commits intomainfrom
fix/npm-peer-dep-conflict

Conversation

@iqbalhasandev
Copy link
Copy Markdown
Member

Summary

npm ci was failing in all CI jobs due to a peer dependency version conflict:

  • eslint-plugin-react@7.37.5 requires eslint@^9.7 but project uses eslint@10

Neither package has released a version that officially supports the other's major version yet.

Fix

Added .npmrc with legacy-peer-deps=true so npm uses the relaxed peer dependency resolution algorithm, allowing installation to succeed. The lock file has been regenerated with this setting applied.

Test plan

  • Verify npm ci succeeds in CI
  • Verify all workflow jobs pass

Add .npmrc with legacy-peer-deps=true so npm ci resolves peer
dependency version mismatches that block CI installation.
Copilot AI review requested due to automatic review settings April 12, 2026 04:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to unblock CI by allowing npm ci to complete despite an ESLint peer dependency mismatch by relaxing npm’s peer dependency resolution.

Changes:

  • Added a repository-level .npmrc enabling legacy-peer-deps.
  • (Per PR description) Regenerated dependency lockfile using the relaxed peer dependency behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Peer dep @inertiajs/react was not installed as a devDependency, causing
tsc to fail with TS2307 when resolving imports in source files.
Remove project-wide .npmrc legacy-peer-deps setting as it affects
all npm installs including local dev. Instead, pass --legacy-peer-deps
directly to npm ci in CI workflows.

Needed until eslint-plugin-react officially supports eslint@10.
…t 19

- Add react-dom, @testing-library/dom and @types/react-dom as explicit
  devDependencies (were silently skipped by --legacy-peer-deps)
- Add Jest moduleNameMapper shim for react-dom/test-utils which was
  removed in React 19 but still unconditionally required by
  @testing-library/react internals
Rename react-dom-test-utils-shim.js to .cjs so it is ignored by ESLint.
Update eslint.config.js ignore pattern from *.cjs to **/*.cjs so
CJS files in subdirectories are also excluded from linting.
@iqbalhasandev iqbalhasandev merged commit c625e9d into main Apr 12, 2026
9 checks passed
@iqbalhasandev iqbalhasandev deleted the fix/npm-peer-dep-conflict branch April 12, 2026 05:17
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.

2 participants