Question

APP Platform: App reloading leads to 404 site

steps to reproduce:

visiting my site under: https://achilles-7z9p9.ondigitalocean.app click on any site in the navigation do a reload

Expectation getting the page for the route Receive: 404 page

i just find answers for droplet Apps :(

Subscribe
Share

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

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.

@balzerrei @dikshith This worked for me, steps to solve:

ex:
name: myapp
region: fra
static_sites:
  - build_command: |-
      npm install
      npm install -g @angular/cli@11.2.0
      ng build --prod
    environment_slug: node-js
    gitlab:
      branch: master
      deploy_on_push: true
      repo: myrepo/myapp
    name: myapp
    output_dir: dist
    catchall_document: index.html
    routes:
      - path: /
  • find app id by running: doctl apps list
  • update spec by runing: doctl apps update {{ap_id}} --spec app.yaml
  • Item

@balzerrei @dikshith This worked for me, steps to solve:

ex:
name: myapp
region: fra
static_sites:
  - build_command: |-
      npm install
      npm install -g @angular/cli@11.2.0
      ng build --prod
    environment_slug: node-js
    gitlab:
      branch: master
      deploy_on_push: true
      repo: myrepo/myapp
    name: myapp
    output_dir: dist
    catchall_document: index.html
    routes:
      - path: /
  • find app id by running: doctl apps list
  • update spec by runing: doctl apps update {{ap_id}} --spec app.yaml
  • Item

@Ghenadie works like a charm! 😁

Thanks for your answer @dikshith.

With this new catchall_document I am getting always the index.html instead of the requested e.g.: team.html when i am on /team and do a hard reload.

This is not what I am looking for. So other than publishing the site as a web Serve instead of a static site a can’t resolve this issue?

Hello @balzerrei

You have to use catchall_document to fix this routing issue. We don’t support it in UI yet. You might have to configure catchall_document via doctl or API. There is a similar discussion in our another community link which might help:

https://www.digitalocean.com/community/questions/react-router-and-app-platform-problems

Cheers,

Dikshith