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

オープン 初心者向け
#25,946 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript, yaml

調査の方向性

scripts/verify-packages-versions.jsから始め、特にリンク先の行付近にあるYAMLの解析を確認してください。スクリプトがCRLFの改行を含むpnpm-workspace.yamlをどのように処理するかを確認し、その改行形式でビルドを実行してください。workspaceのパッケージ一覧が正しく比較され、Windowsでビルドが成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
8.8k
フォーク
1.9k
平均マージ
1日 19時間
マージ済み PR(30日)
664

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-javascript のほかの issue

getsentry/sentry-javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。