Skip to content

Desktop UI does not build from a clean checkout (npm ci ERESOLVE, react/react-dom major mismatch, missing vite-env.d.ts, broken beforeBuildCommand) #1518

Description

@Justin-vcloud

Summary

v2/crates/wifi-densepose-desktop/ui cannot be installed or built from a clean checkout. Four independent problems, each blocking the next.

1. npm ci fails — lockfile is unsatisfiable

npm error code ERESOLVE
npm error While resolving: @types/react-dom@19.2.3
npm error Found: @types/react@18.3.28
npm error Could not resolve dependency:
npm error peer @types/react@"^19.2.0" from @types/react-dom@19.2.3

2. react and react-dom are on different majors

ui/package.json declares:

"react": "^18.3.1",
"react-dom": "^19.2.5"

react-dom@19's createRoot requires React 19. Forcing the install through with --legacy-peer-deps converts the install error into a blank white window at runtime — the assets load, then React throws on mount.

3. tsc fails — missing vite-env.d.ts

src/main.tsx(3,8): error TS2882: Cannot find module or type declarations
for side-effect import of './design-system.css'.

src/design-system.css exists; nothing in the project references vite/client, and there is no src/vite-env.d.ts, so TypeScript doesn't know about CSS side-effect imports.

4. beforeBuildCommand points at a directory that does not exist

tauri.conf.json:

"beforeDevCommand": "cd ../ui && npm run dev",
"beforeBuildCommand": "cd ../ui && npm run build"

Relative to tauri.conf.json, ../ui resolves to v2/crates/ui, which doesn't exist — the frontend is at v2/crates/wifi-densepose-desktop/ui. cargo tauri build fails with:

Running beforeBuildCommand `cd ../ui && npm run build`
The system cannot find the path specified.
Error beforeBuildCommand `cd ../ui && npm run build` failed with exit code 1

(Changing it to cd ui && … did not work either in my run, so the hook's working directory may not be the config directory — worth confirming on your side.)

Suggested fixes

  • Align React: react and react-dom both ^19.2.8; @types/react ^19.2.18, @types/react-dom ^19.2.4. Regenerate package-lock.jsonnpm ci then succeeds.
  • Add ui/src/vite-env.d.ts containing /// <reference types="vite/client" />.
  • Fix the beforeBuildCommand / beforeDevCommand paths.

With all four applied, npm cinpm run buildcargo tauri build --no-bundle completes and the app renders correctly.

Environment: Windows 11, Node 24.14.1, npm 11.11.0, Rust 1.97.1, 5780c239.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions