The pathParse function in RescriptReactRouter.res currently treats single slash and double slash URLs identically, which causes routing conflicts and prevents proper URL differentiation.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- react
- Domain
- frontend
Research direction
Start in RescriptReactRouter.res at the pathParse function and inspect the split and filter logic for slash-separated paths. Verify the behavior for /analytics-transaction and //analytics-transaction, then confirm that the resulting lists preserve the leading empty segment only for the double-slash URL.
Written by the indexing model from the issue text.
Description
Current Behavior
// Both URLs return the same parsed result
pathParse("/analytics-transaction") → list{"analytics-transaction"}
pathParse("//analytics-transaction") → list{"analytics-transaction"} // Problem!
Expected Behavior
// URLs should parse differently to enable proper routing
pathParse("/analytics-transaction") → list{"analytics-transaction"}
pathParse("//analytics-transaction") → list{"", "analytics-transaction"} // Should preserve leading empty string
Impact
- Cannot differentiate between /path and //path in routing logic
- Causes "Page Not Found" errors for valid double slash URLs
- Breaks routing patterns that rely on double slash prefixes
Proposed Solution
Modify the filter logic to preserve the first empty string while removing others:
// Current problematic code
raw->Js.String2.split("/")->Js.Array2.filter(item => item->Js.String2.length != 0)->arrayToList
// Proposed fix
let splitArray = raw->Js.String2.split("/")
let filteredArray = []
splitArray->Js.Array2.forEachi((item, index) => {
if item->Js.String2.length != 0 || index == 0 {
filteredArray->Js.Array2.push(item)->ignore
}
})
filteredArray->arrayToList
- Dominant language
- ReScript
- Stars
- 517
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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.
More from rescript-lang/rescript-react
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
rescript-lang/rescript-react#152 · 3 reactions ·
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
rescript-lang/rescript-react#147 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
rescript-lang/rescript-react#111 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
rescript-lang/rescript-react#105 ·
-
Scroll Restoration Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
rescript-lang/rescript-react#104 · 1 reaction ·
All issues in rescript-lang/rescript-react
Similar issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 ·
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cancervariants/metakb#902 ·
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Save States Menu Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100