Question

Multiple Angular apps in a single App Platform app - routing issue

I have 3 angular apps. Configured them to run all 3 in a single App Platform application as 3 components.

  • app1 has route “/” and output-dir app1
  • app2 has route “/app2” and output-dir app2
  • app3 has route “/app3” and output-dir app3

App1 is working fine on “/” path. I’ve also added the catchall document so routing on app1 is working.

The issue is that when trying to access “/app2” or “/app3” I receive an blank page (the tab title is shown correctly, but the page is empty).

After pushing to master, the build command are the following ones, so the files are placed correctly:

"build": "ng build && mv dist/app1 app1",
"build": "ng build && mv dist/app2 app2",
"build": "ng build && mv dist/app3 app3"

When trying to access “/app2” or “app3” I also receive the following errors in console.

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I fixed the issue thanks to the DigitalOcean support:

" Hello,

Thanks for contacting DigitalOcean.

We understand you are seeing issues with the routing your applications. As those are Angular static site typically they expect to be routed to the / root folder by default. The error you are seeing in the browser console typically indicates as such. The site is not able to find the javascript it expects.

This sometimes has to do with your base_ref and setting that in the build command may help address this issue.

Some more details on some ways to address this can be found here: https://stackoverflow.com/questions/56632496/failed-to-load-module-script

If you have any questions, please let us know.

Regards, Nate Developer Support Engineer II Check out our community for great tutorials, articles and FAQs! https://digitalocean.com/community "

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel