fix: force IPv4 DNS in web-ext sign to fix fetch failed error

Node.js 18+ resolves DNS with IPv6 preference by default. On Linux systems
where IPv6 routing to addons.mozilla.org is broken or unavailable, this causes
web-ext's fetch to silently fail. Setting --dns-result-order=ipv4first via
NODE_OPTIONS ensures IPv4 is tried first.

https://claude.ai/code/session_01G6wo3QBwKjEgAM7j5hQkx4
This commit is contained in:
Claude
2026-04-21 01:14:57 +00:00
parent 03dd61d8bd
commit 459130b049
+3 -1
View File
@@ -86,7 +86,9 @@ for attempt in $(seq 1 $MAX_ATTEMPTS); do
echo "=== Attempt $attempt: signing v$NEW_VERSION ==="
# Capture output to check for specific errors
OUTPUT=$(npx web-ext sign \
# NODE_OPTIONS forces IPv4 DNS resolution first — Node.js 18+ defaults to IPv6,
# which silently fails when the system can't reach addons.mozilla.org over IPv6.
OUTPUT=$(NODE_OPTIONS='--dns-result-order=ipv4first' npx web-ext sign \
--no-config-discovery \
--source-dir "$SCRIPT_DIR/dist/firefox" \
--artifacts-dir "$SCRIPT_DIR/dist/firefox-signed" \