-
-
Notifications
You must be signed in to change notification settings - Fork 13
Closed as not planned
Description
Version
2.9.1
Describe the bug
The TypeError is thrown when the current URL only has empty path segments and atleast 2 empty path segments.
To Reproduce
- Use the LocationProvider component.
- Navigate to an URL with only empty path segments and more than one empty path segments.
Expected behavior
Should navigate to either the default route or a "/" route.
Fix
The error is thrown by the LocationProvider component inside the first useMemo call.
When the new URL(url, base) is called with a relative URL '//'(or more empty slashes), then it seems it is treated as a protocol-relative URL(https://en.wikipedia.org/wiki/URL#Protocol-relative_URLs).
Created here:
So these URL objects don't match the actual URL anymore.
An idea to fix is to pass the full URL to the URL constructor as a single argument.
That seems to work fine.
Metadata
Metadata
Assignees
Labels
No labels