fix(frontend): resolve TypeScript 5 peer dep conflict breaking npm ci - #56
Open
github-actions[bot] wants to merge 1 commit into
Conversation
…flict
react-scripts@5.0.1 declares peerOptional typescript@"^3.2.1 || ^4" but
the project uses typescript@^5.2.2 (5.8.3 locked). npm 8+ enforces peer
deps strictly and causes npm ci to fail with ERESOLVE on Node 18+ runners.
Adding "overrides": { "typescript": "$typescript" } to package.json tells
npm to use the project's declared TypeScript version everywhere in the tree,
suppressing the conflict. The package-lock.json is regenerated to match.
Fixes: CI lint-and-test job failure in PR #55.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
npm ciwas failing withERESOLVEin thelint-and-testjob on Node 18+ runners:react-scripts@5.0.1is unmaintained and only declares support for TypeScript^3.2.1 || ^4as a peer dependency. The project usestypescript@^5.2.2(locked at5.8.3). npm 8+ (Node 18+ runners) enforces peer dependencies strictly by default, sonpm ciexits non-zero.The
build-statusjob then fails as a cascade becauselint-and-testfailed.Fix
Added an npm
overridesfield tofrontend/package.json:The
$typescriptreference resolves to the version declared independencies(^5.2.2), telling npm to use TypeScript 5 everywhere in the tree and suppress the peer dep conflict. Thepackage-lock.jsonwas regenerated withnpm install --package-lock-onlyto reflect the new resolution (TypeScript version stays at5.8.3, react-scripts stays at5.0.1). Verified withnpm ci --dry-run— no ERESOLVE.Closes / unblocks #55.