Debugger not working invalid (or missing) template file
See original GitHub issueDescribe the bug
Lambda debug does not works, when press to “Start Debugging” button an error appear:
Invalid (or missing) template file (path must be workspace-relative, or absolute):
To Reproduce
- Open template.yaml
- Press on button “Add Debug Configuration”
- Configure Lambda payload and environmentVariables (optional)
- Press on “Start Debugging”
The .vscode/launch.json file look like this:
{
"configurations": [
{
"type": "aws-sam",
"request": "direct-invoke",
"name": "MyFunction",
"invokeTarget": {
"target": "template",
"templatePath": "template.yaml",
"logicalId": "MyFunction"
},
"lambda": {
"runtime": "nodejs12.x",
"payload": {
"path": "event.json"
},
"environmentVariables": {
"MY_VARIABLE": "test"
}
}
}
]
}
Expected behavior
The Lambda function start locally and VSCode debug is attached to it
Desktop (please complete the following information):
- OS: Linux
- Visual Studio Code Version: 1.51.1
- AWS Toolkit Version: v1.15.0
Additional context
The template file path is correct position, I tested with a simple “stat/file/cat” in terminal and the path is correct, same behaviour using relative or absolute path.
$ file template.yaml
template.yaml: ASCII text
$ file /home/me/project/template.yaml # just an example or my absolute path
template.yaml: ASCII text
The template file is correct, I currently deploy it as SAM application without any issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:29 (14 by maintainers)
Top Results From Across the Web
Invalid (or missing) template file (path must be workspace- ...
I'm trying to debug a python function locally with VSC and I receive the following error message: Invalid (or missing) template file (path ......
Read more >Error: Unable to Start Debugging on the Web Server
When you try to debug an ASP.NET application running on a Web server, you may get this error message: Unable to start debugging...
Read more >Working with serverless applications - AWS Toolkit for VS ...
In the Open Folder dialog box, navigate to the serverless application folder that you want to open. Choose the Select Folder button.
Read more >Debugging configurations for Python apps in Visual Studio Code
For now, in the Select a debug configuration menu that appears, select Python File. Debug configurations menu. Note: Starting a debugging session through...
Read more >How to Fix the 'Preview Could Not Be Loaded' Error
Enable Safe Mode. · Make sure the theme files exist · Make sure that the Site Address (URL) is the same as the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The file el is generated by CDK and I can use it just fine via command line
sam local invoke .... But AWS Toolkit does not load it preventing me from using sam cli Debug Configuration. We are starting the sam local invoke debugger with a VS Code preLaunchTask and attaching to the debugger to workaround this problem but it would be nice for AWS Toolkit to support the same templates sam cli doesWe should surface this somehow, will keep this open to track that.