From 42b8afd412a731c3c0261f998adbe7c6f191135f Mon Sep 17 00:00:00 2001 From: asepharyana Date: Fri, 7 Aug 2026 10:57:18 +0700 Subject: [PATCH] fix(flake): purge dangling pnpm symlinks in standalone tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit noBrokenSymlinks fails frontend build: .next/standalone/node_modules/.pnpm/ node_modules/semver -> missing target. The standalone server never resolves pnpm's hoisted .pnpm dir (it bundles its own node_modules) — delete broken symlinks before install so stdenv check passes. --- flake.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flake.nix b/flake.nix index 845483c..23609bb 100644 --- a/flake.nix +++ b/flake.nix @@ -249,6 +249,13 @@ WRAPPER cp -r .next/static $out/lib/gmw-frontend/standalone/.next/static cp -r public $out/lib/gmw-frontend/standalone/public 2>/dev/null || true + # Remove dangling symlinks left by pnpm's hoisted .pnpm layout + # (e.g. node_modules/.pnpm/node_modules/...). The standalone server + # never resolves those at runtime — it bundles its own node_modules + # — and they trip stdenv's noBrokenSymlinks check. + find $out/lib/gmw-frontend/standalone -type l \ + ! -exec test -e {} \; -delete 2>/dev/null || true + mkdir -p $out/bin cat > $out/bin/gmw-frontend << WRAPPER #!${pkgs.runtimeShell}