[Dashboard] Docker build fails: @vitejs/[email protected] incompatible with [email protected] (peer dependency conflict)
Descripción del problema
Al ejecutar docker compose -f docker-compose.dev.yml up -d, el build del servicio dashboard falla en el paso RUN npm ci con un error de peer dependency.
Error completo
npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: @vitejs/[email protected] npm error Found: [email protected] npm error npm error Could not resolve dependency: npm error peer vite@"^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" from @vitejs/[email protected] npm error npm error Conflicting peer dependency: [email protected] npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps
Causa raíz
dashboard/package.json especifica vite@^8.0.13 y @vitejs/plugin-react@^5.1.4. Sin embargo, @vitejs/[email protected] solo declara soporte para vite@^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0, excluyendo vite 8.
Solución propuesta
Actualizar @vitejs/plugin-react en dashboard/package.json a la versión más reciente compatible con vite 8 (probablemente ^6.0.0), y regenerar package-lock.json.
Como parche temporal, cambiar en dashboard/Dockerfile:
- RUN npm ci
+ RUN npm ci --legacy-peer-deps
## Entorno
OS: Windows 11
Docker Desktop: última versión
Imagen base: node:20-alpine (npm 10.8.2)
OpenWA versión: 0.1.6
Same issue. the solution works. Will create pr too in short while
Same here, tried the suggested change: works perfectly. Thanks @cesarpalacios 🙏
i think downgrading vite is better solution
Hi team, greetings to all.
The build failure on docker compose --profile full up -d is caused by a peer dependency conflict in the dashboard: @vitejs/[email protected] only supports up to Vite 7, but the project uses Vite 8.
Using --legacy-peer-deps in the Dockerfile is not the right approach — it just masks the incompatibility.
The proper fix is to upgrade the plugin to v6, which was released alongside Vite 8:
cd dashboard
npm install @vitejs/plugin-react@^6.0.0
This updates both package.json and package-lock.json, resolving the peer dependency conflict cleanly. After that, docker compose --profile full up -d --build should work without issues.
This is a copy of the original that works perfectly and has several security patches applied with the help of AI, which are necessary for production use. You can use and modify it to suit your needs. This is not to steal the author's work or credit, but I believe it's necessary to be able to use it since there's no activity on the original account. https://github.com/A831ARD0/OpenWA_v2.git
Fixed by #136 (upgrade @vitejs/plugin-react to v6, compatible with Vite 8) — now merged to main. Please pull the latest main and rebuild the Docker image. Reopen if it persists.