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

Become a contributor for community

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

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.