onClick / navlinks do no present baseURL to the a tags
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Charles Burg @chb-usace Reported this on 06/16/2025
with:
For the sideBar I have links coded like this:
{
id: "ReportsMenu-CrookedRiverLockWaterLevels",
text: "Crooked River Lock Water Levels",
href: "/reports/CrookedRiverLockHWL",
},
If you click on the item you get to the page no issues. The url is as follows:
http://localhost:5173/office/lre/reports/CrookedRiverLockHWL
If you right click and select open in new page or tab, it fails. The url is as follows:
http://localhost:5173/reports/CrookedRiverLockHWL
The the page displays this message:
The server is configured with a public base URL of /office/lre - did you mean to visit /office/lre/reports/CrookedRiverLockHWL instead?
If I add the following to sidebar-links.js:
const BASE_URL = import.meta.env.BASE_URL;
{
id: "ReportsMenu-CrookedRiverLockWaterLevels",
text: "Crooked River Lock Water Levels",
href: `${BASE_URL}/reports/CrookedRiverLockHWL`,
},
I get a 404 and this message when clicking on the link:
We cant find a page that matches /office/lre/office/lre/reports/CrookedRiverLockHWL
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting sidebar-links.js and the onClick/navigation handling for links with relative href values. Reproduce both normal clicks and opening a link in a new tab while the application uses the /office/lre base URL; done means both paths resolve correctly without duplicating the base URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100