fix(flake): purge dangling pnpm symlinks in standalone tree

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.
This commit is contained in:
asepharyana
2026-08-07 10:57:18 +07:00
parent 7575a701bd
commit 42b8afd412
+7
View File
@@ -249,6 +249,13 @@ WRAPPER
cp -r .next/static $out/lib/gmw-frontend/standalone/.next/static cp -r .next/static $out/lib/gmw-frontend/standalone/.next/static
cp -r public $out/lib/gmw-frontend/standalone/public 2>/dev/null || true 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 mkdir -p $out/bin
cat > $out/bin/gmw-frontend << WRAPPER cat > $out/bin/gmw-frontend << WRAPPER
#!${pkgs.runtimeShell} #!${pkgs.runtimeShell}