normalizeUrl bug leads to routeBasePath issues #3374
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
difficulty: intermediate
Issues that are medium difficulty level, e.g. moderate refactoring with a clear test plan.
good first issue
If you are just getting started with Docusaurus, this issue should be a good place to begin.
help wanted
Asking for outside help and/or contributions to this particular issue or PR.
🐛 Bug Report
The "normalizeUrl" pure utility function looks like to it has a bug.
https://github.com/facebook/docusaurus/blob/master/packages/docusaurus-utils/src/index.ts#L281
Tried to add the following test cases:
And the 2 and 3 test cases failing seems unexpected to me
I think this is the reason why blog/docs option
routeBasePath: ''
fail, whilerouteBasePath: '/'
works.I'm going to disallow
routeBasePath: ''
as a fix for now (#3375).But still think we should solve the normalizeUrl issue even if the
routeBasePath: ''
is fixed.The function is not very easy to understand, but is totally pure, so if someone wants to try providing a fix that would be very helpful ;)
The text was updated successfully, but these errors were encountered: