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

已關閉 適合新手
#25,946 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
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 天 20 小時
30 天內合併 PR
682

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

getsentry/sentry-javascript 的其他 Issue

查看 getsentry/sentry-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。