From c131896432a9b74b61550b88beab06a347504598 Mon Sep 17 00:00:00 2001 From: Timmy Date: Sun, 17 May 2026 23:46:55 +0100 Subject: [PATCH] fix: work around npm optional-deps bug in frontend npm install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `npm ci` alone hits npm/cli#4828: optional platform-specific bindings (e.g. @rolldown/binding-linux-arm64-gnu introduced by 1119's vite 5→8 upgrade) listed in package-lock.json for the lockfile author's platform are not fetched for the build platform. The sled rebuild fails with `Cannot find native binding`. Follow `npm ci` with `npm install --include=optional --no-save` so the build platform's native binding is fetched without mutating the lockfile. Co-Authored-By: Claude Opus 4.7 (1M context) --- docker/Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8b887e8f..32e705a4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -46,8 +46,14 @@ WORKDIR /app # build.rs) can produce the release binary with embedded frontend assets. COPY . . -# Build frontend deps first (better layer caching) -RUN cd frontend && npm ci +# Build frontend deps first (better layer caching). +# `npm ci` alone hits npm's optional-dependencies bug (npm/cli#4828): +# platform-specific bindings (e.g. @rolldown/binding-linux-arm64-gnu) +# listed in package-lock.json for the lockfile author's platform are +# not installed for the build platform. Follow `npm ci` with a +# `--no-save --include=optional` install so the build platform's +# native binding is fetched without mutating the lockfile. +RUN cd frontend && npm ci && npm install --include=optional --no-save # Build the release binary (build.rs runs npm run build for the frontend) RUN cargo build --release \