mrking2you
mrking2you10mo ago

Unable to find local file with installed deno module

I am working on porting the 'octoherd/cli' to Deno. One of the things it does is load a script module to execute. octoherd run -S script.js [...args] While working locally, the cli can find script.js , and everything works as expected. When I run deno install or compile, and try to run the CLI, I get the following error
deno run https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js run -S examples/script.ts
or
deno compile -A https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js
./octoherd run -S examples/script.js
or
deno install -A https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js
../.deno/bin/octoherd run -S examples/script.js
deno run https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js run -S examples/script.ts
or
deno compile -A https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js
./octoherd run -S examples/script.js
or
deno install -A https://deno.land/x/octoherdcli@v0.2.13-alpha/octoherd.js
../.deno/bin/octoherd run -S examples/script.js
✅ Granted all read access. { path: "/Users/.../octoherd-cli-deno/examples/script.ts" } ✅ Granted all net access. error: Uncaught (in promise) Error: [octoherd] /Users/.../octoherd-cli-deno/examples/script.ts does not exist throw new Error([octoherd] ${path} does not exist); ---- I can 100% confirm the file exists. Here is what works in local development
deno run -A octoherd.js run -S examples/script.js'
deno run -A octoherd.js run -S examples/script.js'
5 Replies
mxdvl
mxdvl10mo ago
The triple dots makes the path invalid
mrking2you
mrking2you10mo ago
@mxdvl, I did that on purpose for the post. @mxdvl any ideas on the issue? It does not like dynamically importing the module from the file specified on cmd line.
mxdvl
mxdvl10mo ago
No, sorry. I’m wondering if dynamic imports are supported by compile and install
mxdvl
mxdvl10mo ago
https://deno.land/manual/tools/compiler this seems to suggest it won’t work
Deno
deno compile | Manual | Deno
If you omit the OUT parameter, the name of the executable file will be inferred.
mxdvl
mxdvl10mo ago
I think that importing arbitrary JS files is the domain of the Deno runtime, not that of compiled executables.