Skip to content

Conversation

Copy link

Copilot AI commented Oct 7, 2025

Problem

Running npm install in the wrongsecrets-balancer/ui directory failed with an ERESOLVE peer dependency conflict:

npm error ERESOLVE could not resolve
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error Could not resolve dependency:
npm error peerOptional typescript@"^3.2.1 || ^4" from [email protected]
npm error Conflicting peer dependency: [email protected]

The root cause is that [email protected] expects TypeScript 3.x or 4.x, but the project uses TypeScript 5.9.2, creating a peer dependency mismatch.

Solution

Added .npmrc file in wrongsecrets-balancer/ui with legacy-peer-deps=true to instruct npm to use the legacy peer dependency resolution algorithm, which allows the installation to proceed despite the version mismatch.

This approach:

  • Aligns with existing infrastructure - The Dockerfile already uses npm ci --legacy-peer-deps on line 11
  • Minimal change - Single configuration file, no code or dependency modifications
  • Safe - TypeScript 5 is backward compatible with code written for TypeScript 4
  • Standard practice - Common solution for projects using Create React App with newer TypeScript versions

Verification

All tests and builds pass successfully:

  • npm install completes without errors
  • npm ci works correctly
  • npm run build produces optimized production build
  • ✅ All 30 balancer tests pass
  • ✅ All 25 cleaner tests pass
  • ✅ Linting passes

Fixes the issue reported where developers were unable to install dependencies locally.

Original prompt

This section details on the original issue you should resolve

<issue_title>fix dependency issue</issue_title>
<issue_description>in /wrongsecrets-balancer/ui
we get the following issue:

npm install
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/typescript
npm error   dev typescript@"^5.9.2" from the root project
npm error   peerOptional typescript@"^4.7 || 5" from @formatjs/[email protected]
npm error   node_modules/@formatjs/intl
npm error     @formatjs/intl@"2.10.15" from [email protected]
npm error     node_modules/react-intl
npm error       react-intl@"^6.8.4" from the root project
npm error   3 more (fork-ts-checker-webpack-plugin, react-intl, tsutils)
npm error
npm error Could not resolve dependency:
npm error peerOptional typescript@"^3.2.1 || ^4" from [email protected]
npm error node_modules/react-scripts
npm error   dev react-scripts@"^5.0.1" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/typescript
npm error   peerOptional typescript@"^3.2.1 || ^4" from [email protected]
npm error   node_modules/react-scripts
npm error     dev react-scripts@"^5.0.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/razr/.npm/_logs/2025-10-07T02_43_44_016Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/razr/.npm/_logs/2025-10-07T02_43_44_016Z-debug-0.log
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>
Fixes #989

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

🚀 Preview Deployment Ready!

Your pull request has been built and is ready for preview deployment.
Here's how to test your changes:

Container Images Built

  • Balancer: ghcr.io/OWASP/wrongsecrets-balancer:pr-990
  • Cleaner: ghcr.io/OWASP/cleaner:pr-990

Quick Deploy with Helm

# Add the wrongsecrets helm repository
helm repo add wrongsecrets https://owasp.org/wrongsecrets-ctf-party
helm repo update

# Deploy with preview images
helm install my-preview wrongsecrets/wrongsecrets-ctf-party \
  --set balancer.repository=ghcr.io/OWASP/wrongsecrets-balancer \
  --set balancer.tag=pr-990 \
  --set wrongsecretsCleanup.repository=ghcr.io/OWASP/cleaner \
  --set wrongsecretsCleanup.tag=pr-990 \
  --set imagePullPolicy=Always

# Port forward to access locally
kubectl port-forward service/wrongsecrets-balancer 3000:3000

Deploy with Custom Values

Click to see preview-values.yaml
balancer:
  repository: ghcr.io/OWASP/wrongsecrets-balancer
  tag: pr-990

wrongsecretsCleanup:
  repository: ghcr.io/OWASP/cleaner
  tag: pr-990

# Preview configuration
ingress:
  enabled: true
  hosts:
    - host: >-
        preview-pr-990.wrongsecrets.local
      paths:
        - "/"
# Save the above values to preview-values.yaml, then:
helm install my-preview wrongsecrets/wrongsecrets-ctf-party \
  -f preview-values.yaml

Deploy with Local Build Scripts

# Clone this PR
git fetch origin pull/990/head:pr-990
git checkout pr-990

# Use the existing deployment script with custom images
./build-and-deploy.sh

Test the Changes

  1. Access the application at http://localhost:3000
  2. Create a team and verify functionality
  3. Test any new features or bug fixes

Container Registry

The preview images are available at:


This preview was automatically generated for PR #990

Copilot AI changed the title [WIP] fix dependency issue Fix npm dependency conflict in wrongsecrets-balancer/ui by adding .npmrc Oct 7, 2025
Copilot AI requested a review from commjoen October 7, 2025 02:59
Copilot finished work on behalf of commjoen October 7, 2025 02:59
@commjoen commjoen marked this pull request as ready for review October 7, 2025 03:03
@commjoen commjoen requested a review from bendehaan as a code owner October 7, 2025 03:03
@commjoen commjoen merged commit 8c0c0af into main Oct 7, 2025
12 checks passed
@commjoen commjoen deleted the copilot/fix-2864f88e-6d13-4de8-8430-e4bf6c5041f4 branch October 7, 2025 03:04
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.

fix dependency issue

2 participants