You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: API method to restart project / reinstall dependencies after changing package.json #35
Currently, when using the JavaScript SDK’s vm.applyFsDiff to modify package.json, the changes are written to the file system but do not trigger dependency installation or restart the dev server. This means:
Newly added dependencies are not installed until the entire embed is reloaded.
Changes to scripts, startCommand, or other config have no effect until reload.
The only workaround is to reload the iframe, which resets runtime state and is disruptive.
template launcher alters the package.json via vm.applyFsDiff method for corresponding project via embedGithubProject
stackblitz does not detect the change and the packages aren't installed
Proposed solution
Introduce an API method in the SDK that allows developers to programmatically re-run the initialization flow after changes to package.json, without destroying the VM session. For example:
awaitvm.installDependencies();// installs based on current package.jsonawaitvm.restart();// restarts dev server with updated config
Benefits
Smoother UX for dynamic demos where dependencies or commands change on the fly
No need to reload iframe → preserves state
Consistent with how StackBlitz handles package.json on initial project load
Example use cases
Adding a dependency on user action (e.g., “Add Tailwind CSS” button in a tutorial)
Switching between example setups with different dependency sets
Activity