Summary
When the Vite dev server stops while a code app is open through the Local Play URL, the app keeps running normally with no visual indication that anything changed. HMR is silently dead — edits no longer appear — so developers often don't notice until their changes "don't work." Refreshing during the outage shows only "We could not retrieve your app."
This is a common workflow interruption (dev server crash, accidental Ctrl+C, restart onto a different port that stales the saved Local Play URL), and today there's no out-of-the-box signal at any layer.
Environment
@microsoft/power-apps-vite 1.0.2
- Vite 8.0.13,
@microsoft/power-apps-cli 1.0.0 (pa app run)
- Windows 11, Chrome 153
Repro steps
- Run
pa app run, open the printed Local Play URL
- Kill the dev server process
- Observe: the loaded app continues working normally — no error, no warning
- Edit any source file → nothing happens (HMR websocket is gone)
- Refresh while the server is still down → player error screen
What would help
Any of the following would address it — happy with whatever the team thinks fits best in the platform:
- In-app indicator injected by the Vite plugin — e.g. a banner/toast when the HMR websocket drops, cleared on reconnect. I validated this approach locally using Vite's client events (
vite:ws:disconnect / vite:ws:connect) and it works inside the Local Play iframe.
- Player-side improvement — when the player can't reach
_localAppUrl/_localConnectionUrl, show an actionable message ("Your local dev server at http://localhost:5173 isn't reachable — restart pa app run") instead of the generic "We could not retrieve your app."
- CLI-level guardrails — e.g. a stable/port-pinning option for
pa app run so saved Local Play URLs don't go stale after a restart.
- Docs — if none of the above are planned short-term, a note in the debugging docs about this failure mode and its recovery path.
Why it matters
- The embedded-player workflow makes the existing console-only message (
[vite] server connection lost. Polling for restart...) effectively invisible
- The current refresh error doesn't point at the actual cause, so developers debug their app instead of their terminal
Summary
When the Vite dev server stops while a code app is open through the Local Play URL, the app keeps running normally with no visual indication that anything changed. HMR is silently dead — edits no longer appear — so developers often don't notice until their changes "don't work." Refreshing during the outage shows only "We could not retrieve your app."
This is a common workflow interruption (dev server crash, accidental Ctrl+C, restart onto a different port that stales the saved Local Play URL), and today there's no out-of-the-box signal at any layer.
Environment
@microsoft/power-apps-vite1.0.2@microsoft/power-apps-cli1.0.0 (pa app run)Repro steps
pa app run, open the printed Local Play URLWhat would help
Any of the following would address it — happy with whatever the team thinks fits best in the platform:
vite:ws:disconnect/vite:ws:connect) and it works inside the Local Play iframe._localAppUrl/_localConnectionUrl, show an actionable message ("Your local dev server athttp://localhost:5173isn't reachable — restartpa app run") instead of the generic "We could not retrieve your app."pa app runso saved Local Play URLs don't go stale after a restart.Why it matters
[vite] server connection lost. Polling for restart...) effectively invisible