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
✅ 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
5 Replies
The triple dots
…
makes the path invalid@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.
No, sorry. I’m wondering if dynamic imports are supported by
compile
and install
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.I think that importing arbitrary JS files is the domain of the Deno runtime, not that of compiled executables.