Open Amitzw2 opened 3 months ago
Could you show me your configuration and page folder structure?
My page folder is structured like this: Inside my “docs” directory:
As for configuration, I have my config.mts:
Also, inside .vitepress I have a sidebars directory, with a versioned directory inside and a file named “1.3.2.json”.
Thanks! :)
Hey same guy here, I am only going to use this account in the future.
I tried to reproduce this bug on another computer, and it did come up again. I wanted to make sure I did it as pure as possible without changing anything I shouldn't (to make sure it wasn't some misconfiguration on my end). To reproduce I have done these steps:
vitepress init
to create a fresh vitepress project.defineConfig
with defineVersionedConfig
.versioning
and versioning.latestVersion: "2.0.0"
to the config.mts.vitepress dev
I managed to get the same result as before, and clicking on 1.0.0 inside the version switcher resulted in a 404 error.
To test it in another way and make sure it was a bug, I cloned the plugin repo locally and ran the test-docs
on my computer to check this issue (using the viterpess dev
command). I received the same result.
Both times choosing a version redirected me to /version
(e.g. http://localhost:5173/0.1.0/
) which resulted in a 404 page. There is no page called 0.1.0 inside the main directory, so it does make sense.
Trying to access the older version (0.1.0) through a link, I tried using /versions/0.1.0
. It did work and I could see what was meant to be shown for version 0.1.0.
Trying to choose a version through the switcher:
Trying to access /versions/0.1.0
:
I tried to edit the switcher definition and added versions/
on line 27 of switcher.ts. This expectedly resulted in the same result shown in the second picture, and I think it could be a solution to this problem.
@IMB11 Have you seen this issue happen to anyone else? Or could it still be something with my usage? If it happens for everyone should I open a PR that fixes just that?
Do you have a GitHub repo I can reproduce this with? Im struggling to manually try and trigger the issue using a blank setup.
Added you to a private repo here. Running vitepress dev
in this repo should reproduce what I'm talking about.
I'll look at this throughout the week :)
Hey! Have you looked into this by any chance?
I'll have to look at in sometime in the future, not got alot of time lately
I cant reproduce this, I've been trying for a good hour now, not sure what is happening, it could just be a cache issue on your end?
When choosing an older version from the versions menu, I am redirected to /0.1 which doesn’t exist (leads to 404). The version’s page (which saved in versions/0.1/index.md) is only served through /versions/0.1 and could only be accessed through there.
Is there a way to make it serve older versions without /versions before the version?