diff --git a/modules/lamassu-lnbits.nix b/modules/lamassu-lnbits.nix index aff78be..6993fbc 100644 --- a/modules/lamassu-lnbits.nix +++ b/modules/lamassu-lnbits.nix @@ -419,7 +419,9 @@ in # Explicitly rebuild problematic native modules that pnpm rebuild may miss # These modules often fail to build during pnpm rebuild due to missing toolchain in PATH echo "==> Rebuilding specific native modules..." - for module in node-expat iconv argon2; do + + # node-expat and iconv use standard node-gyp + for module in node-expat iconv; do module_path=$(find node_modules/.pnpm -name "$module" -type d -path "*/$module" 2>/dev/null | head -1) if [ -n "$module_path" ] && [ -f "$module_path/binding.gyp" ]; then echo " Rebuilding $module at $module_path..." @@ -427,6 +429,13 @@ in fi done + # argon2 uses node-pre-gyp (different build system) + argon2_path=$(find node_modules/.pnpm -name "argon2" -type d -path "*/argon2" 2>/dev/null | head -1) + if [ -n "$argon2_path" ]; then + echo " Rebuilding argon2 at $argon2_path..." + (cd "$argon2_path" && npx node-pre-gyp install --fallback-to-build 2>&1) || echo " Warning: argon2 rebuild failed, continuing..." + fi + echo "==> Building project..." # Use setsid to run turbo in a new session, isolating it from signal propagation # This prevents pnpm's signal handling issues (exit code -2) when turbo calls pnpm run build