fresh
fresh copied to clipboard
[bug] deno compile binary does not work on other machines
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
- including deno.json by running
deno compile --include deno.json main.ts
will also create the same error. - Possibly relevant information:
- I (cross) built both binaries on windows.
- running the binary on the compiling host, no matter where it is on the system - will always work.
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
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.