eShopOnContainer - Docker: Visual Studio gives 404 Page not found exception exception trying to load the SPA Web App

Viewed 251

I have successfully cloned, built and run the latest Dev branch for eShopOnContainers - Microsoft's reference architecture for Microservices

However, I am unable to launch the SPA Webapp service Web SPA: http://localhost:5104 --- RETURNS 404***

ALL of the below endpoints work Fine

  • Web MVC: http://localhost:5100 - Works and able to launch the MVC web app
  • Web Status: http://localhost:5107
  • Microservices
  • Catalog microservice: http://localhost:5101 (Not secured)
  • Ordering microservice: http://localhost:5102 (Requires login - Click on Authorize button)
  • Basket microservice: http://localhost:5103 (Requires login - Click on Authorize button)
  • Identity microservice: http://localhost:5105 (View "discovery document")

Any pointers as to how to debug why the SPA WebApp is not working are much appreciated.

2 Answers

I had the same problem. Solution for me was the following:

cd <your_repo_path>\src\Web\WebSPA\
npm install
ng build

Now start debugging from VS2019.
Browse to http://host.docker.internal:5104/ (or http://localhost:5104/).
You should now see the SPA app.

macOS

On macOS it all worked fine as described earlier by Meeting Attender:

cd WebSPA
npm install
ng build

Windows

Install missing packages first:

cd WebSPA
npm install

Then I had to install Angular CLI to be able to run ng build command:

npm install -g @angular/cli
ng build

Without installing Angular CLI I was getting "ng: command not found" error when trying to run ng build.

Run docker-compose project and navigate to http://host.docker.internal:5104/.

At first I saw ERR_EMPTY_RESPONSE page: enter image description here

But after ~ 20 seconds later SPA page reloaded itself automatically and everything worked fine:enter image description here

Related