denoland / fresh

The next-gen web framework.
https://fresh.deno.dev
MIT License
12.15k stars 619 forks source link

[bug] deno compile binary does not work on other machines #2402

Open Bloodiko opened 4 months ago

Bloodiko commented 4 months ago

As I wanted to run my deno fresh app in a blacksite, with no internet access at all, I tried to use deno compile.

Issue

Starting the compiled binary on another host, than the compiling one will always throw the Error:

Could not find a deno.json file in the current directory or any parent directory.

More details

I guess, when using deno compile, something hard codes the deno.json path into the binary and it will be searched for in the hard-coded full-path, which it will never find on another system (unless the folder structure is identical).

I will link the test release with this exact binaries I built, so that they can be used for testing: Binary Releases

marvinhagemeister commented 4 months ago

Thanks for reporting this. My guess is that it breaks on the part where we search for the deno.json file in the project directory by traversing upwards from Deno.cwd(). This probably needs to be handled differently.