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

Đang mở Phù hợp với người mới
#25,946 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript, yaml
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Bắt đầu với scripts/verify-packages-versions.js, đặc biệt là phần phân tích YAML gần dòng được liên kết. Kiểm tra cách tập lệnh xử lý pnpm-workspace.yaml với ký tự kết thúc dòng CRLF, sau đó chạy bản dựng với định dạng kết thúc dòng đó. Hoàn thành khi các danh sách gói của workspace được so sánh chính xác và bản dựng thành công trên Windows.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
8.8k
Fork
1.9k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
664

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-javascript

Tất cả issue của getsentry/sentry-javascript

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.