awslabs / llrt

LLRT (Low Latency Runtime) is an experimental, lightweight JavaScript runtime designed to address the growing demand for fast and efficient Serverless applications.
Apache License 2.0
7.92k stars 350 forks source link

TLS: ReferenceError: Error resolving module '/var/task/tls #1

Open ymwjbxxq opened 10 months ago

ymwjbxxq commented 10 months ago

Hello,

as suspected, TLS is the one that blocks the first usage of this LLRT

Lambda config:

  Function:
    MemorySize: 256
    Architectures: ["arm64"]
    Runtime: provided.al2
    Layers:
      - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:LLRT:1

Deployed with

    Metadata:
      BuildMethod: esbuild
      BuildProperties:
        External:
          - '@aws-sdk/client-dynamodb'
          - '@aws-sdk/util-dynamodb'
          - '@aws-sdk/client-sqs'
          - '@aws-sdk/node-http-handler'
          - '@aws-sdk/client-sqs'
        Minify: true
        Target: "es2020"
        Sourcemap: false
        EntryPoints: 
          - list.ts

Packages:

  "dependencies": {
    "@aws-sdk/client-dynamodb": "^3.433.0",
    "@aws-sdk/util-dynamodb": "^3.433.0",
    "@aws-sdk/client-sqs": "^3.433.0",
    "@gomomento/sdk": "^1.45.0",
    "uuid": "^9.0.1"
  },

Log:

INIT_START Runtime Version: provided:al2.v25 Runtime Version ARN: arn:aws:lambda:eu-central-1::runtime:dce29199fb5887a2c4fceaa2f34d395ba43a74a6895b381cb9383b1c7f3b5875
Binary launched
Decompressing using 2 threads
Extraction time: 13.0210 ms
Extraction + write time: 17.8990 ms
Starting app
Error resolving module '/var/task/tls' from '/var/task/list.js'
START RequestId: d8cd0ae3-357a-4cbf-83c1-6351390603e8 Version: $LATEST
Unknown application error occurred Runtime.Unknown
END RequestId: d8cd0ae3-357a-4cbf-83c1-6351390603e8
REPORT RequestId: d8cd0ae3-357a-4cbf-83c1-6351390603e8 Duration: 1063.00 ms Billed Duration: 1063 ms Memory Size: 256 MB Max Memory Used: 28 MB
richarddavison commented 10 months ago

Hi @ymwjbxxq. Thanks for reporting! TLS is on the roadmap. It's an often a critical component for communicating with third party services from the server side. Is there a frontend SDK of momento you can use while this is being addressed?

ymwjbxxq commented 10 months ago

Hi @ymwjbxxq. Thanks for reporting! TLS is on the roadmap. It's an often a critical component for communicating with third party services from the server side. Is there a frontend SDK of Momento you can use while this is being addressed?

Sadly no.