Skip to content

fix: YAML parse errors silently discard pnpm workspace and produce missing-catalog warnings #342

Open

Description

@gigitux

Syncpack version

15.3.3

Operating system(s)

Mac

Steps to reproduce

A leading tab on a comment in pnpm-workspace.yaml causes the workspace file to be silently discarded, even though the catalog definition is still present.

This reproduction creates a temporary directory and writes an actual tab before the comment:

repro_dir=$(mktemp -d)
cd "$repro_dir"

cat > package.json <<'JSON'
{
  "name": "repro",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "webpack": "catalog:tooling"
  }
}
JSON

cat > .syncpackrc <<'JSON'
{
  "versionGroups": [
    {
      "dependencies": ["webpack"],
      "policy": "catalog"
    }
  ]
}
JSON

printf 'catalogs:\n\t# Tooling dependencies\n    tooling:\n        webpack: 5.97.x\npackages:\n    - packages/*\n' > pnpm-workspace.yaml

npx --yes syncpack@15.3.3 lint
echo "Exit status: $?"

# Control: change only the comment's indentation from one tab to four spaces.
printf 'catalogs:\n    # Tooling dependencies\n    tooling:\n        webpack: 5.97.x\npackages:\n    - packages/*\n' > pnpm-workspace.yaml

npx --yes syncpack@15.3.3 lint
echo "Exit status: $?"

Expected behavior

Comment indentation should not produce a misleading missing-catalog warning. If the YAML parser rejects the file, Syncpack should report the parsing error with the filename and exit unsuccessfully, instead of proceeding as though the workspace file were absent.

Actual behavior

With the tab-indented comment:

  • The workspace YAML is not loaded, so its catalog definitions and workspace package patterns are unavailable.
  • The webpack consumer is reported as DependsOnMissingCatalogDefinition, although catalogs.tooling.webpack is defined in the file.
  • No YAML parsing error is reported, and lint exits with status 0.

Replacing the tab with four spaces loads the workspace and resolves the catalog successfully.

Code of Conduct

Activity

  1. JamieMason commented on Oct 2, 2026

    @JamieMason
    Owner

    Thanks a lot for the detail @gigitux, I will take a look.

  2. gigitux commented on Oct 2, 2026

    @gigitux
    Author

    @JamieMason I wonder if the issue is inside the parser logic and not related to the syncpack codebase.

    EDIT: It looks like that it's related to synpack codebase. I can take a look in the next days.

  3. gigitux commented on Oct 3, 2026

    @gigitux
    Author

    @JamieMason I opened #343. I think errors from from_workspace should propagate and stop execution, so Syncpack reports the parsing error instead of continuing without the workspace configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions