impeccable icon indicating copy to clipboard operation
impeccable copied to clipboard

[Bug] Live mode infinite page-reload loop in Vite projects (.impeccable/ sits inside the watched root)

Open muhammadolim opened this issue 6 months ago • 2 comments

What happens

Running /impeccable live in a Vite project triggers an infinite full-page-reload loop. The app reloads repeatedly with no user action, making the page unusable.

Root cause

The live helper persists runtime state under .impeccable/live/ at the project root (server.json heartbeat, session journals under sessions/). Vite's file watcher only ignores node_modules and .git by default, not .impeccable/. So every heartbeat/state write is seen as a project file change and triggers a full page reload, which makes the live client reconnect, which causes another write, which reloads again, forever.

This is independent of variant generation; it starts as soon as the helper is running and writing state. (Distinct from #150, which is about variant injection writing into a parent template and losing page state.)

Environment

  • impeccable skill v3.5.0 (Claude Code plugin)
  • Vite 6 + React 19 SPA with HMR
  • Confirmed: stopping live-server.mjs immediately ends the loop, and .impeccable/live/server.json is the file being rewritten.

Repro

  1. In a Vite project, run /impeccable live.
  2. Boot live.mjs and open the dev-server URL.
  3. Observe the page reloading repeatedly without any interaction.

Suggested fixes (any one)

  • Auto-add and/or document a Vite server.watch.ignored: ['**/.impeccable/**'] entry during init/live setup.
  • Write the helper's runtime/heartbeat state outside the project root (e.g. OS temp), keeping only config.json in-repo.
  • Detect Vite at live setup and offer a watch-ignore patch, similar to the existing CSP consent flow.

muhammadolim avatar Jun 01 '26 09:06 muhammadolim

Thanks for flagging this @muhammadolim , we have a vite native adapter in the works, that should fix this. Will keep you posted.

abdulwahabone avatar Jun 02 '26 22:06 abdulwahabone

Closing this, since it seems to be fixed.

abdulwahabone avatar Aug 04 '26 06:08 abdulwahabone