Mohammad-Faisal / aws-sam-typescript-boilerplate

This is a template project for AWS SAM with TypeScript setup
https://www.toptal.com/aws/typescript-jest-aws-sam-tutorial
7 stars 5 forks source link

sam local invoke "Test-Lambda" --event event.json #4

Closed OscarJVD closed 6 months ago

OscarJVD commented 6 months ago

sam local invoke "Test-Lambda" --event event.json Invoking app.handler (nodejs14.x) Skip pulling image and use local one: public.ecr.aws/sam/emulation-nodejs14.x:rapid-1.52.0-x86_64.

Mounting C:\Users\HP\OneDrive\Pendientes\InProgress\social-publisher-workspace\poc-lambda-ts\aws-sam-typescript-boilerplate\src\test-lambda as /var/task:ro,delegated inside runtime container START RequestId: b1a33474-46a0-4676-9a6d-4277fbc1623a Version: $LATEST 2024-04-20T14:27:07.470Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'app'\nRequire stack:\n- /var/runtime/UserFunction.js\n- /var/runtime/Runtime.js\n- /var/runtime/index.js","stack":["Runtime.ImportModuleError: Error: Cannot find module 'app'","Require stack:","- /var/runtime/UserFunction.js","- /var/runtime/Runtime.js","- /var/runtime/index.js"," at _loadUserApp (/var/runtime/UserFunction.js:225:13)"," at Object.module.exports.load (/var/runtime/UserFunction.js:300:17)"," at Object. (/var/runtime/index.js:43:34)"," at Module._compile (i

OscarJVD commented 6 months ago

we had to execute tsc command at the root