Skip to content

[Bug]: [Bug]: Potential double hash URL issue in HashRouter redirect logic in App.jsx #364

@5hivam123

Description

@5hivam123

Bug Description

🐛 Bug Description
In src/App.jsx, the useEffect redirect logic appends
window.location.hash to the new URL, which can cause double
hash URLs like /#/dashboard#/dashboard if hash is already present.

📍 Location
src/App.jsx — Line ~13-17

🔁 Steps to Reproduce

  1. Open app with a URL containing hash e.g. /#/dashboard
  2. useEffect fires and appends hash again
  3. URL becomes /#/dashboard#/dashboard

✅ Expected Behavior
Should redirect cleanly without duplicating hash fragments.

❌ Actual Behavior
Can produce malformed URLs with double hash fragments.

💡 Fix

// ❌ Current broken code:
window.location.replace('/#' + path + window.location.hash);

// ✅ Fixed code:
window.location.replace('/#' + path);

📁 File
src/App.jsx

Metadata

Metadata

Assignees

Labels

NSoC'26NSoC 2026bugSomething isn't workingenhancementNew feature or requestgssocGirlScript Summer of Codegssoc26GirlScript Summer of Code 2026needs-reviewIssue needs reviewneeds-triagensocNSoC

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions