Open kadiryazici opened 2 years ago
Can you provide a more complete reproduction and what is specifically not working?
With deno compile
all the sources are generated based on the compiler options at the time they are generated and inlined in the binary. Once that is done, the compiler options have no further impact, as the compiled binary does not interpret or emit code, so there is nothing directly generated by the resulting binary that emitDecoratorMetadata
would impact.
@kitsonk I use a package called alosaur
and it is decorators based library, to use it we need to enable emitDecoratorMetadata
. With deno run
it works but when I compile the app it gives error about metadata.
You can find the source code here https://github.com/kadiryazici/deno-crud
Currently I use deno bundle app.ts bundle.js && deno compile bundle.js
to make it work as single executable.
I can confirm, having the same issue with emitDecoratorMetadata
@kitsonk I use a package called
alosaur
and it is decorators based library, to use it we need to enableemitDecoratorMetadata
. Withdeno run
it works but when I compile the app it gives error about metadata.You can find the source code here https://github.com/kadiryazici/deno-crud
Currently I use
deno bundle app.ts bundle.js && deno compile bundle.js
to make it work as single executable.
Worked for me!
I believe this is now fixed, can you folks repeat the problem with latest Deno version (1.29.1)?
I still have the same problem with Deno 1.29.1. In my case I'm using tsyringe and reflect-metadata, and it doesn't work when running deno compile
directly. I still rely on @kadiryazici 's trick of bundling-and-compiling.
This issue is still present using Deno 1.38.2, using InversifyJS and reflect-metadata.
In Deno 1.39.0, still facing the same issue with NestJS, which internaly uses reflect-metadata. ref. https://github.com/nestjs/nest/blob/18335ffa9d53d7efd4f1529761f3539f035aaa79/packages/core/index.ts#L7
Not sure if this is any help, but I've been working on a new dependency injection library for JavaScript that does not rely on experimentalDecorators
or emitDecoratorMetadata
, but solely uses stage 3 class decorators that work fine with Deno.
Not trying to advertise (it's a non-profit open-source project anyway), but just to mention alternatives that work well on Bun.
When we compile our deno app to an executable, it compiles it without deno.json options. I needed
emitDecoratorMetadata
in my project and it works fine with config file but when I compile it, it does not work.