Skip to content

Dependency Injection not working in AWS Lambda  #1472

Open
@jrglg

Description

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request
  • Other... Please describe:

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

2022-11-30T09:48:53.263Z a6ce2161-b66a-42c9-b211-0fb192650c92 ERROR TypeError: Cannot read property 'testMethod' of undefined at j_.handler [as LAUNCH] (/var/src/components/GlobalComponent.ts:26:22) at Vk.executeHandler (/var/node_modules/@jovotech/framework/src/ComponentTreeNode.ts:90:40) at processTicksAndRejections (internal/process/task_queues.js:95:5) at Hj.handle (/var/node_modules/@jovotech/framework/src/plugins/HandlerPlugin.ts:58:5) at vj.run (/var/node_modules/@jovotech/framework/src/Middleware.ts:24:7) at Aj.run (/var/node_modules/@jovotech/framework/src/MiddlewareCollection.ts:108:7) at mk.handle (/var/node_modules/@jovotech/framework/src/App.ts:246:7) at Runtime.handler (/var/src/server.lambda.ts:16:3)

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions