mrrfv / cloudflare-gateway-pihole-scripts

Use Cloudflare Gateway DNS/VPN to block ads, malware and tracking domains - free alternative to NextDNS, Pi-hole and Adguard
MIT License
349 stars 981 forks source link

"response.body?.pipeTo is not a function" while downloading filter lists using Node.js v16 #31

Closed mrrfv closed 1 year ago

mrrfv commented 1 year ago

@hlqviet Tagging you because this might be related to #25 (though I'll try to fix this on my own in my free time).

This is most likely caused by the old Node.js version, that we have to support because that's what the original GitHub Actions workflow uses.

Environment

  node: v16.20.2
  npm: 8.19.4
  yarn: 1.22.19

Error

> Run bash ./get_recommended_whitelist.sh
file:///home/runner/work/***/***/cloudflare-gateway-pihole-scripts/lib/utils.js:69
    await response.body?.pipeTo(writableStream, { preventClose: true });
                         ^

TypeError: response.body?.pipeTo is not a function
    at downloadFiles (file:///home/runner/work/***/***/cloudflare-gateway-pihole-scripts/lib/utils.js:69:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async downloadLists (file:///home/runner/work/***/***/cloudflare-gateway-pihole-scripts/download_lists.js:18:3)
    at async file:///home/runner/work/***/***/cloudflare-gateway-pihole-scripts/download_lists.js:32:5
Error: Process completed with exit code 1.
vietthedev commented 1 year ago

Here you go #32