ritwickdey / vscode-live-server

Launch a development local Server with live reload feature for static & dynamic pages.
https://ritwickdey.github.io/vscode-live-server
MIT License
5.59k stars 1.2k forks source link

Support live reloading on 404 page #2882

Open MaddyGuthridge opened 6 months ago

MaddyGuthridge commented 6 months ago

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[X] Feature request
[ ] Documentation issue or request
[ ] Other: <!-- Please describe: -->

Current behavior

Currently, if an HTML page isn't found, a simple 404 page is served instead. However, this page does not support live reloading, so if the page is created, it will remain on the 404 page.

This is important for my use case, as I use a simple script to build documentation for a library I maintain. When I run this script, it will temporarily delete the documentation directory, resulting in Live Server reloading only to get a 404. When the new build is written, the 404 page does not reload.

Expected behavior

When attempting to navigate to a page that does not exist, return a 404 page that has the same logic for live reloading.

Environment

Browser:

- [ ] Chrome (desktop) version XX
- [X] Firefox version 122
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:

- Live Server: v5.7.9
- Platform:  Windows, Linux
- Visual Studio Code: 1.85.1

Others

Thanks <3