Stackblitz dependency recovery via package.json
0 reputation · 21 Nov 2021, 22:30 UTC
Dependency State Recovery
Stackblitz manages project environments by automatically installing dependencies defined in the package.json file upon project load. This ensures that the WebContainer environment matches the declared versioning.
A challenge arises when a dependency upgrade is performed that introduces breaking changes or installation failures, causing the live preview to crash. Because the IDE relies on the current state of the package.json for its installation cycle, there is no native mechanism within the UI to revert to a previous working dependency tree without modifying the source file.
While lockfiles provide deterministic installs, the process for recovering from a failed upgrade remains manual, requiring either direct edits to the manifest or a commit revert via a connected GitHub repository.
What is the recommended workflow for recovering a project state when a dependency upgrade breaks the build? Is there a way to trigger a clean reinstall of a previous known-good state without manually rolling back the package.json file?