Azure / Azure/static-web-apps-cli
The following error was encountered: Unexpected token '', "{ "na"... is not valid JSON
- Dominant language
- TypeScript
- Stars
- 668
- Forks
- 156
- PR merge metrics
- No merged PRs in 30d
Description
SWA Version: 2.0.4
**Describe the bug**
When I run _swa deploy_ or _swa_ I get a JSON validation error, even my JSON's config files for the staticwebapp-config.json are all valid json.
With this state I can not deploy a SWA with a config.
**To Reproduce**
1. Place a json with the name "staticwebapp.config.json" in our "app" folder with the content `{}`
2. Run `swa deploy`
The following error occurs on my end:
_WARNING: Failed to read staticwebapp.config.json configuration from:
C:\folder1\folder2\folder3\client\staticwebapp.config.json_
_✖ The following error was encountered: Unexpected token '', "{}" is not valid JSON
Please fix the above error and try again to load and use the configuration.
Read more: https://aka.ms/swa/config-schema_
At this state the _staticwebapp.config.json_ only contains `{}`
But I tried configurations like the this one, and they not working too.
```
{
"navigationFallback": {
"rewrite": "/index.html"
}
}
```
**Error Message**:
_✖ The following error was encountered: Unexpected token '', "{
"na"... is not valid JSON_
**Expected behavior**
Deployment Working
**Desktop (please complete the following information):**
- OS: Windows
- Version PS7
**Additional context**
Add any other context about the problem here.
Contributor guide
Assessment
This issue has not been assessed yet.