question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Before filing this issue, please ensure you’re using the latest CLI by running swa --version and comparing to the latest version on npm.

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
  • 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

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

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.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thomasgauvincommented, Oct 28, 2022

Thanks for reporting this @anfibiacreativa, we should definitely provide better logs/auto-detection to help guide the experience. For context for others reading, this is related to the requirement that the api runtime needs to be configured in staticwebapp.config.json as documented here: https://azure.github.io/static-web-apps-cli/docs/cli/swa-deploy#deploy-a-front-end-app-with-an-api

0reactions
sgollapudi77commented, Dec 22, 2022

Hey @anfibiacreativa , thanks for reporting this. Although the issue is known as you mentioned there is no indication of the error in the logs which is a painful experience for the user. To fix this, there are two active tasks we’re working on

  1. There is an active PR which addresses the last problem you mentioned by automatically detecting the function language.
  2. We’re working on adding more logs in the StaticSiteClient thereby providing user more context over the problem.

Hey @anfibiacreativa , we did a new STaticSiteClient release recently and you should be able to see the logs when deployment failure happens, please check this now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

swa deploy | Static Web Apps CLI
This command is used to deploy the current project to Azure Static Web Apps. Here are some common use cases: Deploy a front-end...
Read more >
Spring Boot Reference Documentation
Try the How-to documents. They provide solutions to the most common questions. Learn the Spring basics. Spring Boot builds on many other Spring...
Read more >
Changelog — Python 3.11.1 documentation
gh-97612: Fix a shell code injection vulnerability in the get-remote-certificate.py example script. The script no longer uses a shell to run openssl commands....
Read more >
Bug listing with status UNCONFIRMED as at 2022/12/24 17 ...
src/plugins/quota/rquota.h: No such file or directory" status:UNCONFIRMED ... Bug:510296 - "sys-apps/portage should not print index info if --quiet is ...
Read more >
2 Server Error Message Reference - MySQL :: Developer Zone
Message: The server is not configured as slave; fix in config file or with ... NO SQL, or READS SQL DATA in its...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found