Visitar URL original
Recursive list emits invalid JSON with separate workspace lockfiles · Issue #15011 · pnpm/pnpm · GitHub
Skip to content

Recursive list emits invalid JSON with separate workspace lockfiles #15011

Closed

Description

@Stanzilla

Problem

pnpm -r list --json emits separate JSON arrays when a workspace uses per-project lockfiles. With more than one selected project, stdout is not a single valid JSON document, so JSON.parse fails.

The same rendering path exists in Rust pnpm v12 and TypeScript pnpm v11 on main at 2c04b22dc84de181586677233563c3ca4d45c2da.

Reproduction

Create this workspace:

# pnpm-workspace.yaml
packages:
  - packages/*
sharedWorkspaceLockfile: false
// packages/project-1/package.json
{"name":"project-1","version":"1.0.0"}
// packages/project-2/package.json
{"name":"project-2","version":"1.0.0"}

Run:

pnpm -r --filter 'project-*' list --json --depth -1

Expected

One JSON array containing both project objects. The same must hold when installed projects have distinct dependencies in separate lockfiles.

Actual

Each project is rendered as a complete array, and those arrays are joined with whitespace: [{...}] [{...}].

The installed-project regression also exposed a related Rust v12 problem: the per-project loader retains the workspace-root modules directory. Dependency paths therefore point under the root's node_modules, and --long reports [Could not find additional info about this dependency] even though the package manifest exists under the selected project. The loader needs the same per-project configuration as installation, including packageConfigs overrides.

Source and proposed scope

Collect typed project results before JSON serialization. Keep each project's own lockfile context, selected-project order, and existing text/parseable output. Add command-level regressions in both versions that parse all of stdout and verify both projects and their different dependencies.


Written by an agent (Codex, GPT-6).

Activity

  1. added 2 commits that reference this issue on Sep 18, 2026
    bfcb64d
    5ca1a8a
  2. added a commit that references this issue on Sep 18, 2026
    aaf1e11
  3. added a commit that references this issue on Sep 25, 2026
    120f332
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions