fix(frontend): resolve TypeScript 5.x peer dep ERESOLVE on npm ci - #43
Open
github-actions[bot] wants to merge 1 commit into
Open
Conversation
…onflict react-scripts@5.0.1 declares peerOptional typescript@"^3.2.1 || ^4" but the MFE work (feat: befd956) bumped typescript to ^5.2.2 without updating package-lock.json. This caused npm ci to detect the lock file was out of sync, attempt fresh resolution, and fail with ERESOLVE on the TypeScript peer dep constraint. Fix: add `overrides: { typescript: "^5.2.2" }` to package.json — npm's overrides field explicitly resolves the conflict and suppresses ERESOLVE. Regenerated package-lock.json with strict peer dep mode so all peer deps (including @testing-library/dom etc.) are present and npm ci passes. Closes: #42 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
The MFE commit (
befd956) addedvite,@originjs/vite-plugin-federation, and@vitejs/plugin-reacttofrontend/package.jsondevDependencies but did not regeneratepackage-lock.json. This causednpm ciin CI to detect the lock file was out of sync and attempt a fresh dependency resolution.During that fresh resolution, npm hit an
ERESOLVEerror:react-scripts@5.0.1only supports TypeScript ≤ 4.x as a peer dep, but the project usestypescript@^5.2.2. npm v7+ enforces peer deps strictly, so this fails without an explicit override.Fix
Two changes to
frontend/:package.json— added"overrides": { "typescript": "^5.2.2" }. npm'soverridesfield explicitly resolves the conflict, telling npm "use TypeScript 5.x regardless of peer dep constraints" and suppressing the ERESOLVE.package-lock.json— regenerated withnpm install(strict mode, with overrides active) so all peer dependencies (including@testing-library/dometc.) are present andnpm ci --dry-runpasses cleanly.No TypeScript 5-specific syntax is used in the source code, so this is a safe change. Vite,
@originjs/vite-plugin-federation, and@vitejs/plugin-reactall work fine with the TypeScript 5 compiler.Test plan
npm ci --dry-runpasses infrontend/lint-and-testjob passes on the merged PRFixes #42