microsoft / microsoft/vscode-livepreview
LiveServer Serving Old Version of File Despite Changes
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 596
- Forks
- 119
- Avg merge
- 1d 4m
- Merged PRs (30d)
- 5
Description
I am experiencing an issue with LiveServer where it continues to serve an old version of a file despite making changes and restarting the server. It doesn't happen for all files. It seems like files that were present the very first time the server was started are frozen, while files that have been added since behave properly.
For example, renk.json existed in my workspace when I first started the Live Server. Now, the server will always server the version that existed at that point in time, whatever changes I make to this file. For testing I tried getting src/main.rs and it behaves the same, an old version is served. On the other hand, src/converters/mod.rs, a file that I created after the first Live Server start (but before the last time I stopped and restarted the server) is served normally, if I make changes to this file, I immediately get the new version.
The clients tested are:
- my own program using Rust and the reqwest crate (the main reason I was using Live Server)
- curl (to try debugging)
- Simple Browser (to double check)
- Firefox ('cause why not..?)
Note: (If applicable) this isn't specifically a web project. Maybe the fact that no html files are served is a problem for Live Preview. I'm developing a little Rust app that fetches its config from a URL. I wanted to use Live Server to locally serve the development config, before hitting a production URL.
Expected Behavior:
LiveServer should serve the latest version of any file, when possible after changes are saved, and in any case when the server is restarted.
Actual Behavior:
LiveServer continues to serve an old version of some of the files, showing a probably cached version from somewhere else (where?).
Environment:
- Version: 1.97.2
- Commit: e54c774e0add60467559eb0d1e229c6452cf8447
- Date: 2025-02-12T23:20:35.343Z
- Electron: 32.2.7
- ElectronBuildId: 10982180
- Chromium: 128.0.6613.186
- Node.js: 20.18.1
- V8: 12.8.374.38-electron.0
- ms-vscode.live-server: 0.4.15 (Last Updated: 2025-02-25, 00:50:06)
Additional Information:
- I have verified that the file paths are correct and that there are no duplicate files (in the workspace).
- I have cleared the browser cache and used
curlwith the-H "Cache-Control: no-cache"option to bypass caching. - I have checked the LiveServer logs and there are no errors or warnings related to this issue.
Screenshots:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with renk.json, src/main.rs, and src/converters/mod.rs, comparing files present at the first server start with files added later. Start by serving each file after edits and a server restart, then verify responses with curl using Cache-Control: no-cache and compare them with the saved files. Done means every file returns its latest saved contents after restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- backend, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100