D
Deno

help

Unable to find local file with installed deno module

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

Looking for more? Join the community!

Recommended Posts
Importing NPM packages with `npm:` where package has `@` in the nameI want to import the package `@hono/zod-openapi`, version `0.30` I tried to add to my `deno.json` lHow to use KV Connect?Hello there <:HelloThere:730465880991072285> Is there any plan an making an STD module for creatindlopen() from web urlHey, is it possible to provide a url to the dll file from a cdn server? For example if I want to dDoes calling `bundle` inside a handler make sense?hey all I wanted to understand if this is smart to do. I am using the `cacheRoot` option and wanted Is WASM generally faster than using Deno FFI?...Deno hanging when trying to connect with MongooseWhen I try to connect to MongoDB using Mongoose the whole process just hangs until eventually timingEmbeding Dino compiled code within rust (Tauri) code, inside main.rs during build compilation.Hi. Still not sure if this is question for Tauri community or Deno community, so I'll place on both DuckDB deno package broken & npm package segfaultingHas anyone had any luck using DuckDB with Deno? I've tried with the npm package with segfaults on a Get Deno working with ESLintHi! I'm trying out a Deno project and I want to get Deno TS Typing working with ESLint. I understanInstall issueI am triyng to instal Deno but i always get this error and I cant solve it. Help pls!LSP: Uncached or missing @types/node when importing node:processI'd like to understand better what's going on here in case it's a potential bug in node interop: ```Deno vs Node for writing a React component library.Hi all. I love Deno and what it does, but I need some help deciding if it is right for my small projrun code at the start of every hourI would like the most performant code pls.Denoflare scheduled workersCloudflare has a cronjob feature for running workers at a scheduled time. Wrangler has a flag wrangl