Skip to content

fix(desktop): apply pnpm purge guard so post-sync wails dev stops aborting#4024

Merged
esengine merged 1 commit into
main-v2from
fix/desktop-pnpm-modules-purge
Jun 11, 2026
Merged

fix(desktop): apply pnpm purge guard so post-sync wails dev stops aborting#4024
esengine merged 1 commit into
main-v2from
fix/desktop-pnpm-modules-purge

Conversation

@esengine

Copy link
Copy Markdown
Owner

Problem

Every desktop ./dev after an upstream sync fails at the frontend step:

• Compiling frontend: [ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY] Aborted removal of modules directory due to no TTY
[ERROR] Command failed with exit code 1: pnpm install
  at runDepsStatusCheck (.../pnpm.mjs)

Root cause

Two layers:

  1. pnpm 11 verify-deps-before-run. frontend:install (pnpm install) succeeds, but frontend:build (pnpm build) re-verifies deps before running the script (runDepsStatusCheck). After a sync the lockfile changed, so it decides node_modules is stale, triggers a reinstall that wants to remove node_modules, and — spawned by wails dev with no TTY — aborts.

  2. The guard in dev never applied. dev exported PNPM_CONFIG_CONFIRM_MODULES_PURGE=false, but pnpm reads the npm-convention npm_config_*, not PNPM_CONFIG_*:

    env set pnpm config get confirm-modules-purge
    PNPM_CONFIG_CONFIRM_MODULES_PURGE=false undefined
    npm_config_confirm_modules_purge=false false

    So the purge/age guards were dead and the abort surfaced on every sync.

Fix

  • desktop/frontend/.npmrc (committed, TTY/CI/env-agnostic — the real fix; pnpm reads a project .npmrc when a package.json is present, verified):
    • verify-deps-before-run=falsepnpm build no longer re-checks/reinstalls; frontend:install already did.
    • confirm-modules-purge=false — any purge proceeds silently instead of aborting headless.
  • dev — fix the env-var form to npm_config_* so the original headless intent works. minimum_release_age=0 stays dev-only (not committed globally, so the supply-chain age gate is unchanged for everyone else).

Test

cd desktop/frontend && rm -rf node_modules && pnpm install && cd ../.. && ./dev — frontend compiles, no purge abort. The .npmrc settings were validated against pnpm directly (npm_config_* honored, PNPM_CONFIG_* ignored; project .npmrc read with package.json present).

…rting

pnpm honors npm_config_*, not PNPM_CONFIG_*, so dev's guards never took effect.
After an upstream sync, pnpm 11's verify-deps-before-run reinstalls before
`pnpm build`, wants to remove node_modules, and aborts with no TTY under
wails dev (ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY). Pin confirm-modules-purge
+ verify-deps-before-run in a committed desktop/frontend/.npmrc and fix the
env-var form in dev.
@esengine esengine requested a review from SivanCola as a code owner June 11, 2026 11:04
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 11, 2026
@esengine esengine merged commit 83f87c0 into main-v2 Jun 11, 2026
14 checks passed
@esengine esengine deleted the fix/desktop-pnpm-modules-purge branch June 11, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant