gildas-lormeau / single-file-cli

CLI tool for saving a faithful copy of a complete web page in a single HTML file (based on SingleFile)
GNU Affero General Public License v3.0
539 stars 57 forks source link

dns error: failed to lookup address information #66

Closed yfiua closed 3 months ago

yfiua commented 3 months ago

Hi,

I tried to run single-file-cli. Both from dockerhub and git repo build I got the same error:

docker run singlefile "https://www.wikipedia.org"

error: Import 'https://registry-staging.deno.com/@std/path/meta.json' failed: error sending request for url (https://registry-staging.deno.com/@std/path/meta.json): error trying to connect: dns error: failed to lookup address information: Name does not resolve at file:///usr/src/app/single-file-cli-master/single-file-cli-api.js:26:25

It seems it cannot load the json file from deno as the link is broken.

Do you have any idea? Thanks!

gildas-lormeau commented 3 months ago

It looks like it's a bug related to Deno but apparently it's fixed in the last versions, see https://github.com/denoland/deploy_feedback/issues/612. I'm wondering what's happening since the Docker image includes the last version of Deno (I guess).

rutkai commented 3 months ago

I tracked this down as I'm struggling with this for hours now. It won't be updated for a while as

And god knows when it's going to be updated.

gildas-lormeau commented 3 months ago

Thank you for the additional info, I guess the executable files from the Releases page (see https://github.com/gildas-lormeau/single-file-cli/releases) should not suffer from this issue though.

yfiua commented 3 months ago

Release works fine.

rutkai commented 3 months ago

Thank you for the additional info, I guess the executable files from the Releases page (see https://github.com/gildas-lormeau/single-file-cli/releases) should not suffer from this issue though.

But in this case, you need to manually point to the most recent release.

Alternatively, I chose a different base image from deno, installed chromium and it works fine (there is an alpine version too): https://github.com/rutkai/single-file-web/blob/master/Dockerfile

gildas-lormeau commented 3 months ago

I made the code compatible with Node.js and published a new version on Docker Hub based on Node.js instead of Deno.

rutkai commented 3 months ago

Thanks. May I know what's the long term plan here? Staying on deno (and switching back to it once this bug is fixed in the upstream image) or keeping both on the long run?

gildas-lormeau commented 3 months ago

The long term plan should be to stay on deno once the bug is fixed. However, I will do my best to make the code compatible with Node.js though.