aws / aws/aws-toolkit-vscode

Exception when templates.json exists, but is empty

Open
#1,375 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

```
2020-11-02 15:57:06 [ERROR]: [Error: Could not load .aws/templates.json: Error: Could not parse .aws/templates.json: value expected at offset 0, length 0
at /Users/richali/aws-toolkit-vscode/dist/src/lambda/config/templates.js:114:19
at Generator.next ()
at fulfilled (/Users/richali/aws-toolkit-vscode/dist/src/lambda/config/templates.js:9:58)]
2020-11-02 15:57:06 [ERROR]: An error occurred while deploying a SAM Application. Check the logs for more information by running the "View AWS Toolkit Logs" command from the Command Palette.
```

Repro:
* `cat /dev/null > /.aws/templates.json`
* attempt to deploy template with parameters that do not have default values

Contributor guide

Open the contributing guide

Research direction

Start with the stack trace location in dist/src/lambda/config/templates.js at line 114 and reproduce the deployment after creating an empty .aws/templates.json with cat /dev/null. Trace how the empty file is parsed during SAM deployment, then verify that the deployment no longer fails solely because templates.json is empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.