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 returns 404 HTTP status error when the project name has the '%20' charcode in the name #8904
Comments
related: #5194 |
Hi @sapphi-red, could you help with this issue (and the related one)? Maybe it's in some file where the file path gets resolved, some util function that needs to take into account |
This issue is still active. Had a project with %20 in the title and the vite dev did not work with 404 returned. |
Issue is still active as of 1st of August |
Issue still active as of 23rd of August 2033. Was a bit frustrating but thanks for the solution in the meantime! |
Still active, It took some time but this solve it for me, thanks! |
Same here also with Umlauts: ä,ö etc. Huge problem for me, since i rely on it testing german data |
Still active in September 2023... |
Still happening Jan 2024. Glad this article was here after I cloned a repo from Azure that allows poorly name git projects. |
Hello, Met the same problem today, a friend told me to comment my root property in vite.config.ts : import { defineConfig } from 'vite'; export default defineConfig({ Hope that could help |
Is there any fix for this? I think i will return back to CRA :/ |
Describe the bug
Hello. I'm here to report a bug that I found using Vite.
History
I had cloned a personal project that was configured to use Vite for build and serve the solution. After cloned this project, I ran the
vite dev
to start the application, but after enter inhttp://localhost:3000
, it returned 404 error. When I tried to find other resources that was present in the/public
folder, likehttp://localhost:3000/favicon.ico
it returned successfully.After doing some tests to discover the reason for the 404 status by accessing the
index.html
file, I could not find the solution. The project that I was using with vite was created fromnpx create-react-app --template typescript
boilerplate, and the configuration of the Vite was made by hand. Acording with this, I decided to create a react app by using the Vite CLI, and this project started perfectly. So, by tranfering the resources from the first project to the other one, and testing the result little by little, I got both projects completly equal, with the same configurations, plugins, and dependencies. But, the first one still didn't work, but the second (test project) was working normally.So, the unique difference of the project was the name of them, one was "My%20Project", and the second one was "test". So, after decided to change the name of the first one removing the charcode
%20
, the project started working. After putting back the charcode, and ran thevite dev
command, the 404 status code was returned again.Tests
I created some projects using vite, and for any project, when the root folder has the
%20
charcode in the name, the 404 HTTP status is shown.I used the
react-scripts
for build and serve the solution, and it worked as well.Steps
npm create vite@latest
vanilla
for the frameworkvanilla
for the variantvite-project
tovite%20project
npm install
to install the dependenciesnpm run dev
to run the apphttp://localhost:3000/
Stack Overflow Top: https://stackoverflow.com/questions/72834388/vite-with-create-react-app-is-returning-404-error/72848313#72848313
Reproduction
Cannot reproduce via vite.new
System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: