Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] When the page path includes hash/ query, the page will load a 404 error. #1561

Closed
pengzhanbo opened this issue May 19, 2024 · 2 comments · Fixed by #1562
Closed

Comments

@pengzhanbo
Copy link
Member

pengzhanbo commented May 19, 2024

Description

After upgrading from rc.9 to rc.11, there was a change in beforeResolve where the path comparison switched from to.path to to.fullpath.

However, to.fullpath includes the hash portion, which causes issues when the page is first loaded or when navigating to a page with a hash in the path, resulting in the inability to match the correct route and leading to a 404 error.

image

Reproduction

Used Package Manager

pnpm

System Info

vuepress: 2.0.0-rc.11 => 2.0.0-rc.11
@digital-codes
Copy link

digital-codes commented May 19, 2024

Just discovered a probably related bug. Using url query parameters like ?id=1 leads to a 404 as well.
Install a fresh vuepress with cli and npm. Error occurs with any query string

Previous versions worked like so:
https://vp2.akugel.de/news.html?id=1
Now is broken

@pengzhanbo
Copy link
Member Author

Just discovered a probably related bug. Using url query parameters like ?id=1 leads to a 404 as well. Install a fresh vuepress with cli and npm. Error occurs with any query string

Previous versions worked like so: vp2.akugel.de/news.html?id=1 Now is broken

I have also noticed this issue, and I will fix it together in the PR #1562 .

@pengzhanbo pengzhanbo changed the title [Bug report] When the page path includes hash, the page will load a 404 error. [Bug report] When the page path includes hash/ query, the page will load a 404 error. May 19, 2024
meteorlxy added a commit that referenced this issue May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants