Skip to content

There are no packages awaiting approval reports no packages awaiting approval after stashing and re-adding a dependency #12221

Description

@aqeelat

pnpm version

v10.x / v11 (with strict-dep-builds: true default)

Reproduction

pnpm add -D msw
# → ERR_PNPM_IGNORED_BUILDS: Ignored build scripts: msw@2.14.6

pnpm approve-builds
# → Works. 3 files updated: pnpm-workspace.yaml, package.json, pnpm-lock.yaml

git stash
# stash those 3 files (reverts them to pre-msw state)

pnpm add -D msw
# → ERR_PNPM_IGNORED_BUILDS: Ignored build scripts: msw@2.14.6

pnpm approve-builds
# → "There are no packages awaiting approval"  ← BUG

Expected behavior

pnpm approve-builds should detect that msw's build scripts were blocked during the second pnpm add and present it for approval.

Actual behavior

pnpm approve-builds reports no packages awaiting approval, leaving the user stuck. The only workaround is to manually add msw: true to allowBuilds in pnpm-workspace.yaml.

Suspected area

node_modules/.modules.yaml should contain ignoredBuilds after the second pnpm add, but getAutomaticallyIgnoredBuilds() (building/commands/src/policy/getAutomaticallyIgnoredBuilds.ts:14) reads it as empty/undefined. The ignoredBuilds state may be lost or overwritten between the install completing and approve-builds running.


Written by an agent (opencode, glm-5.1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions