Summary
Applying a patch to a project whose dev server is running breaks that project's dev server. The apply pipeline (/api/projects/[id]/update, and cve-lite --fix via /api/security/cve-lite/[id]/fix) runs pnpm install, which relinks node_modules. A live Turbopack/Next dev server loses its handle to node_modules/next mid-reinstall and panics:
FATAL: An unexpected Turbopack error occurred.
Next.js package not found
- Execution of ... directory_tree_to_loader_tree failed
(The accompanying "inferred your workspace root" message is a misleading symptom — next is still installed; the running process just lost it during the churn.)
When HexOps patches itself (the hexops project in the dashboard is this repo), this is self-inflicted: the dev server you're using to click "Apply" is the one that dies.
How it was hit
Observed while testing the CVE Lite per-finding Apply on the hexops project's qs advisory (see PR #108). The override install churned node_modules while node server.js (Turbopack dev) was live → panic → dev server died. Recovery required rm -rf .next + restart.
Current state
- "Fix all direct" confirm dialog already warns: "You may need to restart that project's dev server."
- Per-finding Apply has no such warning.
- Neither actually prevents the breakage.
Proposed
HexOps already tracks per-project process state (start/stop, metrics). Before an apply:
- Detect whether the target project has a running dev server (reuse the start/stop/port tracking).
- If running, guard: either
- warn + require confirmation ("Applying will reinstall dependencies and restart 's dev server"), or
- offer stop → apply → restart orchestrated by HexOps (cleanest), or
- at minimum, surface the warning on the per-finding Apply path too (parity with "Fix all direct").
- Consider auto-
rm -rf .next/dev + restart as part of the orchestrated path so Turbopack comes back clean.
Related
Surfaced during #107 / PR #108 (CVE Lite apply→commit→push). Related to #90 (stop signal propagation) since a clean stop→apply→restart depends on reliable stop.
Summary
Applying a patch to a project whose dev server is running breaks that project's dev server. The apply pipeline (
/api/projects/[id]/update, andcve-lite --fixvia/api/security/cve-lite/[id]/fix) runspnpm install, which relinksnode_modules. A live Turbopack/Next dev server loses its handle tonode_modules/nextmid-reinstall and panics:(The accompanying "inferred your workspace root" message is a misleading symptom —
nextis still installed; the running process just lost it during the churn.)When HexOps patches itself (the
hexopsproject in the dashboard is this repo), this is self-inflicted: the dev server you're using to click "Apply" is the one that dies.How it was hit
Observed while testing the CVE Lite per-finding Apply on the
hexopsproject's qs advisory (see PR #108). The override install churnednode_moduleswhilenode server.js(Turbopack dev) was live → panic → dev server died. Recovery requiredrm -rf .next+ restart.Current state
Proposed
HexOps already tracks per-project process state (start/stop, metrics). Before an apply:
rm -rf .next/dev+ restart as part of the orchestrated path so Turbopack comes back clean.Related
Surfaced during #107 / PR #108 (CVE Lite apply→commit→push). Related to #90 (stop signal propagation) since a clean stop→apply→restart depends on reliable stop.