microsoft/vscode-azurestaticwebapps

Unable to debug React app

dcyprianrw opened this issue · 3 comments

I'm pulling hair out and struggling mightily! I have a mature SWA in which I used to be able to debug in VSCode easily. I just ran the out-of-the-box config and it worked. I changed the file structure and removed the embedded Azure Functions API and now I'm seeing really strange behavior:

Whether I use a swa-cli.config.json or not, VSCode is able to spin up an emulator that does serve data, just not in debug mode. See this picture: The Image behind is just my MS Edge browser where the localhost:4280 does connect. But the empty browser in front is the debugger and it just spins. It doesn't have any console or network messages. It just seems to fail to connect some how!

image

Framework: React
Functions API: No
File structure:

  • git root: C:\build[username]\frequency
  • app root: C:\build[username>]\frequency\web-app

Version info:

  • SWA: 1.1
  • Node: 16.18.1

Hi @dcyprianrw,

Please keep your hair in your head! Could you answer the following questions so that we can help you resolve this issue?

  1. Were you always using Edge to debug? I was wondering because our out of the box debugging experience uses the Chrome debugger.
  2. Could you please share your launch.json?
  3. Are you starting the emulator and then trying to launch the debugger? Your localhost ports are the same in both windows and when you try to launch the debugger, I think there will be some port conflicts there.

Hi @nturinski! Thanks for responding. I'll give you a lot more context:

///////////////
///////////////

Scratch that! I literally logged in this evening just to give you more details, was writing up a post here to take some screen shots and code copies. And it's all working! Chrome is loading, breakpoints working, issue can be closed. I have no idea how. Computer just needed to cool for a day or two, I guess.

Woohoo! Close this issue, gracias.

Awesome, really glad to hear this works and glad that you could keep your hair :)