Azure / Azure/static-web-apps-cli

swa deploy: App without swa config file declaring platform api runtime aborts and fails without printing error info

Open
#595 7 comments 0 reactions 1 assignee Assigned to @sgollapudi77 View on GitHub
priority: medium (P1) scope: deploy-client
Dominant language
TypeScript
Stars
668
Forks
156
PR merge metrics
No merged PRs in 30d

Description

Before filing this issue, please ensure you're using the latest CLI by running `swa --version` and comparing to the latest version on [npm](https://www.npmjs.com/package/@azure/static-web-apps-cli).

**Are you accessing the CLI from the default port `:4280` ?**

- [ ] No, I am using a different port number (`--port`) and accessing the CLI from that port
- [x] Yes, I am accessing the CLI from port `:4280`

> Make sure you are accessing the URL printed in the console when running `swa start`!

**ℹ️ NOTE: Make sure to enable debug logs when running any `swa` commands using `--verbose=silly`**

**Describe the bug**
Angular app with managed API, need to have a configuration file with the following information
`{
"platform": {
"apiRuntime": "node:XX"
}
}`

or deployment stage fails without error being displayed.
This should have blocker priority, because there is absolutely no indication of cause of error that the developer can intuitively fix on their own.

![Screen Shot 2022-10-28 at 5 39 18 PM](https://user-images.githubusercontent.com/4014025/198678876-38dab0bf-4ce3-4c74-80ad-9e083c77de08.png)

When running with verbose, we have more information, additionally referring to the lack of a config.file, although it's not marked as error but warning and you cannot infer the build fails for that reason.

![Screen Shot 2022-10-28 at 5 42 46 PM](https://user-images.githubusercontent.com/4014025/198678940-fb8a6725-b5c6-4008-bcf3-1bdf5a78ca49.png)

**To Reproduce**
1 - create an angular app with Angular CLI
2 - create an HTTP trigger function under ./api with func CLI
3- create a service for the app to request the endpoint
4 - test locally with swa CLI (`swa` + `swa start`)
5 - execute` swa deploy`. The deploy will begin and abruptly abort without error in log after the message deploying to preview.

**Expected behavior**
At minimum the CLI should display output information explaining that a configuration file with platform.apiRuntime config should be created by the user, and a link to documentation.

Ideally, the platform should auto-detect the runtime version and spare the user from having to configure and maintain this configuration file on their own, to configure an item required by the system and not the app.

**Screenshots**
Already provided.

**Desktop (please complete the following information):**

- OS Monterey 12.6
- SWA CLI 1.0.3
- Angular 14.0.2
- Node v16.16.0
- npm version 8.11.0

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.