microsoft / microsoft/vscode-livepreview

When I come back to a codespace, the live preview stops working.

Open
#849 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
596
Forks
119
Avg merge
1d 4m
Merged PRs (30d)
5

Description

I have a small React app that I am building. I do it during my spare time at work, so I am often walking away from it for 30+ minutes at a time. I will be working on it, walk away, and when I come back the hot refresh on the live preview has stopped working. If I then refresh the live preview page, it shows a 404 error. At this point, even if I try to restart npm or close and reopen the codespace, the live preview will only give me a 404 error. Sometimes I can see a glimpse of the github redirect page if I just paste in the local url + the port, so I know it's at least connecting to the port.

If I try and open it on another computer, the live preview is a blank page with a warning in the console saying that it is running in quirks mode.
If I start a new codespace on the React template, that new one will display a live preview with no issues. If I open a new codespace with the same code by forking the project, it continues to work as expected.

Version: 1.132.0
Commit: df53daabb18cd157bdb08c7f01c34df936cf12f4
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Embedder: codespaces

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by leaving a React app in a codespace for more than 30 minutes, then compare the live preview with a fresh or forked codespace. Start by inspecting the live preview page, port URL, 404 response, redirect glimpse, and quirks-mode console warning. Done means the preview remains reachable and hot refresh works after returning to the codespace.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
devtools, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.