From bc45a91b3ec4362b69a076021e8318da94d2ad9d Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 22 Mar 2026 19:28:21 +0000 Subject: [PATCH] Fix frontend tests failing in Docker due to wrong-platform rollup binary The bind-mounted node_modules from macOS contains darwin-arm64 native binaries which don't work in the Linux container. Run npm install on container startup to get the correct platform binaries. Co-Authored-By: Claude Opus 4.6 (1M context) --- docker/entrypoint.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 6cb0e93..6c97dea 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -21,4 +21,14 @@ export GIT_COMMITTER_NAME="$GIT_USER_NAME" export GIT_AUTHOR_EMAIL="$GIT_USER_EMAIL" export GIT_COMMITTER_EMAIL="$GIT_USER_EMAIL" +# ── Frontend native deps ──────────────────────────────────────────── +# The project repo is bind-mounted from the host, so node_modules/ +# may contain native binaries for the wrong platform (e.g. darwin +# binaries on a Linux container). Reinstall to get the right ones. +if [ -d /workspace/frontend ] && [ -f /workspace/frontend/package.json ]; then + echo "Installing frontend dependencies for container platform..." + cd /workspace/frontend && npm install --prefer-offline 2>/dev/null || true + cd /workspace +fi + exec "$@"