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

Offen Anfängerfreundlich
#25,946 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
85/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
node.js, typescript, yaml

Rechercherichtung

Beginne mit scripts/verify-packages-versions.js, insbesondere mit dem YAML-Parsing in der Nähe der verlinkten Zeile. Prüfe, wie das Skript pnpm-workspace.yaml mit CRLF-Zeilenenden verarbeitet, und führe anschließend den Build mit diesem Zeilenendenformat aus. Fertig ist die Aufgabe, wenn die Paketlisten des Workspaces korrekt verglichen werden und der Build unter Windows erfolgreich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Browser Bug
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/)

https://github.com/getsentry/sentry-javascript/blob/9bc20868cb80b102dd42ac92c1fd0a4eaa99727b/scripts/verify-packages-versions.js#L31

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.

Vorherrschende Sprache
TypeScript
Sterne
8.8k
Forks
1.9k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
664

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus getsentry/sentry-javascript

Alle Issues in getsentry/sentry-javascript

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.