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

Problem with sidebar links and history back button #307

Closed
x8x opened this issue Apr 30, 2018 · 7 comments · Fixed by #473
Closed

Problem with sidebar links and history back button #307

x8x opened this issue Apr 30, 2018 · 7 comments · Fixed by #473
Labels
type: bug Something isn't working

Comments

@x8x
Copy link
Contributor

x8x commented Apr 30, 2018

How to reproduce:

clone https://github.com/x8x/test
cd test
vuepress build
http-server -p 3000 -a 127.0.0.1 .vuepress/dist -o
  • open browser and go to http://127.0.0.1:3000/
  • click first link on left sidebar
  • click second link on left sidebar
  • now click the browser history back button and you get a 404
@x8x
Copy link
Contributor Author

x8x commented May 2, 2018

Maybe I should have specified that this happen only when sidebar items name are in Chinese, would be nice if someone else could test and confirm or dismiss. Thanks!

@hustjiangtao
Copy link

I got a 404 too, when refreshing the page or opening the link directly.

@yungsem
Copy link

yungsem commented May 5, 2018

I'm facing the same problem, have you solved it? If so, how?

@yungsem
Copy link

yungsem commented May 5, 2018

I did some checking just now, as @x8x said, it happens when the url contains Chinese. Are there any plans to fix this?

@hmatalonga
Copy link
Contributor

hmatalonga commented May 6, 2018

I have been looking at this problem and here what I have find so far:

  1. When you click for the 1st time on the first link $route.path is "/中文手册.html" which matches with the correct filename generate by the build command.
  2. However once you hit the browser return button, $route.path will be /%E4%B8%AD%E6%96%87%E6%89%8B%E5%86%8C.html this will cause a error not finding the file.

I believe this is simply a problem where the path was normalized with encodeURIComponent on the return action and it wasn't normalized when generating the filename during the build process, so in the end they don't match.

I can work on a PR to try fix this situation 👍

This should also solve the problem #344

@hustjiangtao
Copy link

hustjiangtao commented May 8, 2018 via email

@ulivz
Copy link
Member

ulivz commented May 21, 2018

This should be fixed at #473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants