Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
21 stars 12 forks source link

[Bug] Unable to refresh Org Profile page #1642

Closed rrchai closed 1 year ago

rrchai commented 1 year ago

Is there an existing issue for this?

What projects are you seeing the problem on?

OpenChallenges

Current behavior

After refreshing a Org Profile Page, the page will become blank page with below error in the console:

Screen Shot 2023-06-12 at 10 05 57 PM

Only if going back home page (localhost:4200) and then going to the Org Profile page will be able to re-access the page.

Expected behavior

Refreshing a Org Profile page without problems.

Anything else?

No response

Commit ID

No response

Are you developing inside the dev container?

Code of Conduct

tschaffter commented 1 year ago

The paths to the resources is wrong, here org/ should not be part of the URL. I don't know what could be causing the app to look for these resources at this location.

tschaffter commented 1 year ago

This old post with recent comments may help. This Medium article may also help.

tschaffter commented 1 year ago

@rrchai I'm taking a shot at this issue as it may solve another issue I just bumbed in.

tschaffter commented 1 year ago

Does this error occurs on other pages that are not /?

Several pages can be reloaded properly but not the following pages:

Does this error occurs when running the app with its dev server and/or container?

The error occurs when running the app with its dev server and container, so it's likely an issue with the app itself and not Nginx.

For example, the URL http://localhost:4200/challenge/2 should redirect to http://localhost:4200/challenge/2/breast-cancer-prognosis but this redirection no longer works because the app fails to loads resources like vendor.js.

tschaffter commented 1 year ago

The issue seems to occurs when we access a sub sub page, e.g.

tschaffter commented 1 year ago

Adding back <base href="/" /> to the index.html of the app solves the issue. This line has been removed recently in this PR.