Executable having trouble with types
I'm encountering a syntax error when trying to import files when running an executable, specifically with type imports.
I have included the entire
./src/modules/test
directory into the binary
When running a compiled binary, I'm getting a SyntaxError related to type imports.
Here's the specific code causing issues:
path: ./src/modules/test/commands/testing.ts
Function used to import files:
Full Error Message:
Deno Version: 2.1.29 Replies
Is this a known issue with type imports during compilation?
Are there any recommended workarounds for type imports in compiled Deno executables?
Any insights or help would be greatly appreciated! 🙏
What is
@types
? Is it declared in an import map?Yes it is
Are you passing the import map to the
deno compile
command?yes, the import mapping doesnt seem to be the issue. Everything runs just fine when using
deno run
. It only seems to happen when running a compiled binary
@bartlomieju Sorry for pinging you, but you really helped me last time. I was wondering if you had any idea how I can fix this. Been stuck on this for a few days and can't seem to find anything online.Have you tried importing the types using @deno-types?
https://docs.deno.com/runtime/fundamentals/node/#importing-types
Deno
Node and npm support
In-depth documentation, guides, and reference materials for building secure, high-performance JavaScript and TypeScript applications with Deno
it's a custom type 😄
I think this is a bug in
deno compile
, it might not be including all necessary files, or something goes wrong when you have import type ...
. Could you please open an issue for it with a full repro?