aws-toolkit-vscode
aws-toolkit-vscode copied to clipboard
Cannot find template file when debugging in vs code
Describe the bug I was trying to debug AWS LAMBDA locally in vs code, but I always get the 'Invalid (or missing) template file (path must be workspace-relative, or absolute):' when I run the debug
To reproduce
1.Add new file named as template.yml, copy and paste from serverless.yml to template.yml 2. Click on 'AWS: Add debug configuration' 3. open the launch json, add the payload 4. See error : Invalid (or missing) template file (path must be workspace-relative, or absolute): e:\companyNameWork\XXX-api\template.yml
Expected behavior The debug function would run and has some output in debug console just like other project's done before.
Screenshots
Your Environment
- OS: win10
- AWS Toolkit version: AWS Toolkit v1.37.0
- SAM CLI version: SAM CLI, version 1.40.0
Additional context
- In same conputer, with same process and IDE(vs code), other project could use AWS Toolkit debug perfectly.
- I have tried absolute path and relative path, doesn't work. 3.Tried rebuild the template.yml 4. Tried reopen the IDE 5. Tried reopen the computer 6. The API has been deployed and could work
This means that somehow our file watcher isn't finding the file. Can you check the logs (remove private info)?
- In VSCode settings, ensure that "aws log level" is "debug".
- Perform the steps to reproduce the issue.
- Use the
AWS: View Toolkit Logs
command to get the logs.
Is the file path mentioned in the logs?
This means that somehow our file watcher isn't finding the file. Can you check the logs (remove private info)?
- In VSCode settings, ensure that "aws log level" is "verbose".
- Perform the steps to reproduce the issue.
- Use the
AWS: View Toolkit Logs
command to get the logs.Is the file path mentioned in the logs?
Hi justinmk3, Thanks for your reply and help.
- I changed the log level to 'verbose'
- I deleted the current '.vscode' and template.yml
- I redo the same process like I did before.
This is what I got in log. And I think the file path mentioned in the log.
related: #2613
AWS Toolkit 1.96 includes a potential fix for this issue. https://github.com/aws/aws-toolkit-vscode/pull/3946
Logging was also improved, so if the issue still occurs with 1.96, posting the logs will be helpful. Thanks!