-
-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency Injection not working in AWS Lambda #1472
Comments
Palle gave me a quick fix: I had a Gitlab pipeline, so to keep it working I deleted the then I added a few more config to be like Jovo build npm script:
and changed the So far it's working. |
Hey @palle-k can you explain what the issue is and why the fix works? |
@rmtuckerphx esbuild doesn't emit decorator metadata like the normal typescript compiler does. This metadata includes data like the arguments that a constructor has, including the argument types. The dependency injection system requires this metadata to instantiate classes. That's also the reason why types need to be annotated with This build script restores decorator metadata by compiling files that include decorators with the normal typescript compiler instead of esbuild. |
This is how I updated
Here is the code for
@aswetlow You should add to docs for projects built with Dependency Injection that are deployed to Lambda |
Even though this is kind of an old issue, I just wanted to add, that I recently found out, that for our projects the |
I'm submitting a...
Expected Behavior
Dependency injection system should work in Lambda as it's working in Express.
Current Behavior
A simple Jovo project (starting template) with an injected service doesn't work in Lambda because injections are
undefined
.I attach an example project to test this out.
Error Log
Your Environment
Jovo Framework version used:
@jovotech/cli/4.1.8 win32-x64 node-v14.21.1
Operating System: Windows 10
Example project
test.zip
The text was updated successfully, but these errors were encountered: