Closed sm0ke21 closed 1 month ago
Can you try adding the following setting to your package.json "aws.samcli.enableCodeLenses": true
and then re-running the launch config
As it turns out, as a last resort if we can't find the codeRoot we fall back to discovering the project root:
findParentProjectFile
expects globals.codeLensRegistry to be defined and globals.codeLensRegistry only gets defined when this is true in the settings: "aws.samcli.enableCodeLenses": true
The reason why it goes through that codepath is because originally codeRoot isn't defined because there isn't a CodeUri in the template: https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/src/lambda/local/debugConfiguration.ts#L134
Hey there, first of all thanks for the help.
I have added the setting above to my package.json
file. I then run sam build
and tried to start a debug session and are getting the same error.
{
"name": "delete-test-01",
"description": "delete-test-01-description",
"aws.samcli.enableCodeLenses": true,
"version": "0.0.1",
"private": true,
"dependencies": {
"@aws-sdk/client-dynamodb": "^3.188.0",
"@aws-sdk/lib-dynamodb": "^3.188.0"
},
"devDependencies": {
"aws-sdk-client-mock": "^2.0.0",
"jest": "^29.2.1"
},
"scripts": {
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js"
},
"jest": {
"testMatch": [
"**/__tests__/**/*.[jt]s?(x)",
"**/?(*.)+(spec|test).[jt]s?(x)",
"**/__tests__/**/*.mjs?(x)",
"**/?(*.)+(spec|test).mjs?(x)"
],
"moduleFileExtensions": [
"mjs",
"js"
]
}
}
Ah!
"aws.samcli.enableCodeLenses": true
should actually be in your VSCode settings.json file
Hey @jpinkney-aws ,
That does the trick.
Thank you!
Problem
When I try to run a local debugging session using aws-sam I get the error below:
The project has been initialized by running the following:
My
launch.json
configuration is as follows:Steps to reproduce the issue
sslchecker:getAllItemsFunction (nodejs18.x)
F5
to start debugging sessionExpected behavior
The function should be invoked running in the docker network
sam
(where dynamodb is currently running).System details (run
AWS: About
and/orAmazon Q: About
)OS: Linux x64 5.15.0-117-generic Visual Studio Code extension host: 1.91.1 AWS Toolkit: 3.16.0 node: 20.9.0 electron: 29.4.0