diff --git a/modules/lamassu-lnbits.nix b/modules/lamassu-lnbits.nix index 946f495..45e62b4 100644 --- a/modules/lamassu-lnbits.nix +++ b/modules/lamassu-lnbits.nix @@ -415,6 +415,17 @@ in # Run rebuild separately - this compiles native modules pnpm rebuild || echo "Warning: Some native modules failed to build, continuing anyway..." + # 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 + 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..." + (cd "$module_path" && npx node-gyp rebuild 2>&1) || echo " Warning: $module rebuild failed, continuing..." + fi + done + echo "==> Building project..." # Bypass pnpm and call turbo directly to avoid pnpm signal handling issues # See: https://github.com/pnpm/pnpm/issues/7374