Skip to content

Build script fails on Windows due to CRLF line endings in pnpm-workspace.yaml #25946

Closed

Description

@kunal649

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

N/A (monorepo root)

Framework Version

Node.js 24 on Windows

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  • Clone the sentry-javascript repository on a Windows machine.
  • Ensure Git checks out pnpm-workspace.yaml with CRLF (\r\n) line endings.
  • Run pnpm install and then pnpm run build

Expected Result

The build processes the workspace packages and runs successfully.

Actual Result

The build crashes immediately with the following error:

[INCONSISTENT WORKSPACES]: The packageslist in pnpm-workspace.yaml and theworkspaces list in package.json must contain the same packages in the same order.

I guess this happens because scripts/verify-packages-versions.js rigidly splits the YAML file using .split('\n'). On Windows, this reads the target string as 'packages:\r', causing the match to fail, returning an empty array and triggering the error.

Additional Context

Image

Suggested Solution:
Update scripts/verify-packages-versions.js to handle both line endings by using a regex split: .split(/\r?\n/)

const lines = fs.readFileSync(path.join(__dirname, '../pnpm-workspace.yaml'), 'utf8').split('\n');

I'm happy to open a PR though.

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

  1. linear-code commented on Oct 30, 2026

    @linear-code
  2. henricop commented on Nov 1, 2026

    @henricop

    I can reproduce this. scripts/verify-packages-versions.js splits pnpm-workspace.yaml on '\n' only (line 31), so with a CRLF checkout the header line is packages:\r, lines.indexOf('packages:') returns -1 and the parsed list comes back empty, which is what triggers [INCONSISTENT WORKSPACES].

    The fix I'd propose is a one-line change to split on /\r?\n/, plus a small vitest file next to scripts/bump-version.test.ts that runs the script against LF and CRLF copies of the workspace file and against a real mismatch. Locally the CRLF case fails on develop and passes with the change (vitest run scripts/verify-packages-versions.test.ts).

    Would you like a PR for this against develop?

  3. self-assigned this
    on Nov 4, 2026
  4. github-actions commented on Nov 5, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #26083, which was included in the 11.11.0 release.

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

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions