microsoft / vscode-azurestaticwebapps

Azure Static Web Apps extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps
MIT License
92 stars 35 forks source link

There is an error when debugging the "angular-basic" project #574

Closed v-mengwe closed 2 years ago

v-mengwe commented 2 years ago

OS: All Build Version: 20211105.14 Regression: Not a regression

Repro Steps:

  1. Clone https://github.com/staticwebdev/angular-basic -> Open the project in VS Code.
  2. Open VS Code terminal and run "npm install" -> Go to the "Run and Debug" menu -> Select the "Show all automatic debug configurations." -> Select "Azure Static Web Apps…" -> Select "SWA: Run angular-basic".
  3. Check whether there is no error when debugging.

Expect: There is no error when debugging.

Actual: There is an error when debugging. MicrosoftTeams-image (8)

More Info: The opened browser window as below: MicrosoftTeams-image (7)

alexweininger commented 2 years ago

I'm unable to repro this on my machine - currently seeing if teammates can encounter the same issue.

From the logs it looks like the ng serve command never had a chance to run which seems like dependencies weren't installed properly, but I'm just guessing at this point.

Edit:

If dependencies were not installed then this is the output I get:

image

alexweininger commented 2 years ago

Will was able to reproduce this issue. And in doing some experimentation with Will, I was able to identify that the issue is that ng serve takes long enough on the first run that we need to be using the --devserver-timeout flag in the SWA CLI to make sure ng serve finishes before the SWA CLI times out. I'll have a fix out soon 🤠

The SWA CLI command that works: swa start http://localhost:4200 --run'npm start' --devserver-timeout=100000