OpenWA icon indicating copy to clipboard operation
OpenWA copied to clipboard

[Dashboard] Docker build fails: @vitejs/[email protected] incompatible with [email protected] (peer dependency conflict)

Open cesarpalacios opened this issue 6 months ago • 6 comments

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

 

cesarpalacios avatar May 21 '26 14:05 cesarpalacios

Same issue. the solution works. Will create pr too in short while

NamTheGreat avatar May 21 '26 20:05 NamTheGreat

Same here, tried the suggested change: works perfectly. Thanks @cesarpalacios 🙏

bracketouverte avatar May 21 '26 22:05 bracketouverte

i think downgrading vite is better solution

NamTheGreat avatar May 22 '26 04:05 NamTheGreat

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.

daniklean avatar May 23 '26 22:05 daniklean

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

A831ARD0 avatar May 27 '26 00:05 A831ARD0

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.

rmyndharis avatar Jun 13 '26 05:06 rmyndharis