No error message when index.html file is missing
See original GitHub issueDescribe the bug
If there is no index.html file present then running vite shows no errors and trying to access the page will give a 404 server error. Although having a missing index.html file is obviously wrong and unlikely to happen if using the cli, it’s easy to forget to add one if migrating an existing project from web pack to vite. I would expect vite to show some error message that no html file was found.
Reproduction
- Use the cli to create a vite project.
- Remove the index.html file.
- Run ‘npm run dev’
There will be no error message. Trying to access the page will show a 404 error.
System Info
vite
version: 2.0.0-beta.30- Operating System: MacOS 11.1
- Node version: 14.4.0
- Package manager (npm/yarn/pnpm) and version: npm 6.14.11
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
What Is Index.html? How To Repair It? [SOLVED] - Solvusoft
HTML problems with index.html most often stem from a corrupt or missing Windows file. Replacing your HTML file is generally a solution to...
Read more >InMotion Hosting - YouTube
How to Fix the " Index Of /" Error - Missing index .htm/. html /.php File on Apache ... This is caused by...
Read more >HTML Files are missing - WordPress.org
The downloaded only has the wp-content and the wp-includes folder an the index.html, but all the other HTML files are missing. What I...
Read more >Error in production build: Index html generation failed [closed]
The error is not in the index.html file that you see in the folder structure. It occurs on generating the final index.html.
Read more >"Missing index.html" Errors Filling HTTP Server Error Log
At some point the index.html file in the directory defined in the DocumentRoot directive was removed or permissions were changed to make it ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To serve custom virtual html you need to add a custom middleware using the
configureServer
plugin hook because HTML is not handled as part of the normal transforms during dev.Closing since this is expected - open to a PR to provide more descriptive error message for this though.