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

Vite dev server returns 404 with path with a . #13356

Closed
7 tasks done
ryanmr opened this issue May 28, 2023 · 1 comment
Closed
7 tasks done

Vite dev server returns 404 with path with a . #13356

ryanmr opened this issue May 28, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists pending triage

Comments

@ryanmr
Copy link

ryanmr commented May 28, 2023

Describe the bug

With a react-ts vite template, while running with the vite dev server, I had an app with routes like /sites/example.com or /sites/example.net (domain name shaped in my case, but I think anything abc.xyz would trigger this behavior) fail with 404. Client side routing was OK, but as soon I refreshed the browser on one of these paths, the vite dev server would load the page as a 404 and show nothing. For other routes, this did not happen.

Here's a short video showing the bug.

This issue from a couple years ago is definitely related.

Reproduction

https://github.com/ryanmr/vite-404-example

Steps to reproduce

  1. yarn create vite --template react-ts / cd / install
  2. in App.tsx create a:
    <p>
            <a href="/sites/example.com">
              go to <code>/sites/example.com</code>
            </a>
    </p>
  3. yarn dev
  4. click on the new link in the browser
  5. get 404 from vite dev server
  6. try going to another non-existent page with the vite dev server
  7. should re-load App.tsx / root page

System Info

System:
    OS: macOS 13.2.1
    CPU: (12) arm64 Apple M2 Pro
    Memory: 77.33 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
  Browsers:
    Chrome: 113.0.5672.126
    Edge: 108.0.1462.54
    Firefox: 113.0.1
    Safari: 16.3
  npmPackages:
    @vitejs/plugin-react: ^4.0.0 => 4.0.0
    vite: ^4.3.9 => 4.3.9

Used Package Manager

yarn

Logs

No response

Validations

@sapphi-red
Copy link
Member

Duplicate of #2415

@sapphi-red sapphi-red marked this as a duplicate of #2415 May 29, 2023
@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2023
@sapphi-red sapphi-red added the duplicate This issue or pull request already exists label May 29, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2023
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

No branches or pull requests

2 participants