lambda code not in root (CDK typescript project)
See original GitHub issueDesktop:
- OS: Mac
- VS Code version: 1.52.1
- AWS Toolkit extension version: 1.18.0
When using cdk, how do you setup a lambda debug where the lambda is not in the root?
{
"configurations": [
{
"type": "aws-sam",
"request": "direct-invoke",
"name": "lambda debug",
"invokeTarget": {
"target": "code",
"projectRoot": "",
"lambdaHandler": "lib/lambdas/helloworld/hello.handler"
},
"lambda": {
"runtime": "nodejs10.x",
"payload": {},
"environmentVariables": {}
}
}
]
}
Debugger attached. 2021-01-30T14:01:55.990Z undefined ERROR Uncaught Exception {“errorType”:“Runtime.ImportModuleError”,“errorMessage”:“Error: Cannot find module ‘hello’”,“stack”:[“Runtime.ImportModuleError: Error: Cannot find module ‘hello’”," at _loadUserApp (/var/runtime/UserFunction.js💯13)“,” at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)“,” at Object.<anonymous> (/var/runtime/index.js:45:30)“,” at Module._compile (internal/modules/cjs/loader.js:775:14)“,” at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)“,” at Module.load (internal/modules/cjs/loader.js:653:32)“,” at tryModuleLoad (internal/modules/cjs/loader.js:593:12)“,” at Function.Module._load (internal/modules/cjs/loader.js:585:3)“,” at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)“,” at startup (internal/bootstrap/node.js:283:19)"]}
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (11 by maintainers)

Top Related StackOverflow Question
so I tried the debugger and get this error
@josh803316 I have created https://github.com/aws/aws-toolkit-vscode/issues/2907 to track your issue.