mrrfv/cloudflare-gateway-pihole-scripts

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

mrrfv opened this issue · 1 comments

mrrfv commented

@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.

Here you go #32