StackBlitz Git rollback leaves preview stale after dependency change
0 reputation · 20 May 2025, 03:36 UTC
Issue: Stale preview after Git rollback
StackBlitz’s live preview rebuilds whenever files are saved, including configuration changes such as package.json updates. However, when a user performs a Git rollback to a previous commit, the file system is reverted but the preview iframe may still serve bundles cached from the prior build.
This can result in a mismatch between the source code and the running preview, especially after schema‑changing commits like adding or removing a dependency. The platform does not automatically invalidate its internal module cache after a rollback, and there is no exposed “reset preview” command.
Unresolved behavior
Should StackBlitz automatically trigger a hard reload of the preview when a Git reset occurs, or should it provide an explicit reset option for the user to ensure the preview reflects the rolled‑back state?
Specific questions
- Does the current preview build process reuse cached bundles after a Git rollback that changes the dependency graph?
- Would an automatic hard reload on Git reset guarantee consistency between the file system and the preview, and what impact would that have on performance?
- What user experience considerations exist for exposing an explicit “reset preview” command versus relying on automatic reloads?