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

In History Mode, a route containing a symbol . will be lost after refreshing #4344

Closed
6 tasks done
follisher opened this issue Jul 22, 2021 · 3 comments
Closed
6 tasks done
Labels
duplicate This issue or pull request already exists pending triage

Comments

@follisher
Copy link

follisher commented Jul 22, 2021

Describe the bug

In History Mode, a route containing a symbol . will be lost after refreshing the browser.

Reproduction

  1. Create a vue project with npm create @vitejs/app.
  2. Add vue-router with npm install vue-router@4.
  3. Enable vue-router by using .
  4. Change vue-router to HTML5 History Mode by adding createWebHistory(),
  5. Set base path in vite.config.js like base:'/',
  6. Add a new page and configure the route path, like '/page/:id'
  7. Start the project with npm run dev
  8. Visit the url http://localhost:3000/page/id.name through $router.push works, but direct visits raises error 404.

System Info

System: Mac OS 11.4
browser: Chrome 91.0.4472.164 (Official Build) (x86_64)
vue: 3.1.5
vue-router: 4.0.10
vite: 2.4.3

Used Package Manager

npm

Logs

No response

Validations

@follisher follisher changed the title In history mode, it will be lose routing with refresh the browser when the route has symbol '.' In history mode, a route containing a symbol " . " will be lost after refreshing the browser. Jul 22, 2021
@follisher follisher changed the title In history mode, a route containing a symbol " . " will be lost after refreshing the browser. In history mode, a route containing a symbol " . " will be lost the route after refreshing the browser. Jul 22, 2021
@follisher follisher changed the title In history mode, a route containing a symbol " . " will be lost the route after refreshing the browser. In History Mode, a route containing a symbol . will be lost after refreshing Jul 22, 2021
ygj6 added a commit to ygj6/vite that referenced this issue Jul 22, 2021
@mseele
Copy link

mseele commented Aug 25, 2021

Checkout vite plugin https://github.com/ivesia/vite-plugin-rewrite-all
This should fix the problem (see also #2190)

@maietta
Copy link

maietta commented Apr 14, 2022

This issue was hard to find. I searched for 404 and .html, or 404's with filename extension and many combinations thereof and similar.

By my adding this comment despite this being a closed topic, hopefully others will find it with those keywords.

Also, why is this not fixed with the last merge?

@sapphi-red sapphi-red added the duplicate This issue or pull request already exists label Apr 14, 2022
@sapphi-red
Copy link
Member

duplicate of #2415

@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists pending triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants