Consider dropping Bun 1.3 support in v12

Đang mở
#26,614 1 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bun, node.js, typescript
Lĩnh vực
backend, observability

Hướng nghiên cứu

Start with packages/bun/package.json and .github/workflows/build.yml to review the current Bun minimum and CI matrix. Then check the Bun integration test exclusions and vite.config.mts entries named in the issue. Done means the v12 minimum is Bun 1.4, CI no longer tests 1.3.14, and the Bun 1.3-specific exclusions are removed; this is proposed release policy work and may need maintainer agreement.

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

Mô tả

Bun

Bun 1.3.14 is the oldest Bun version that the SDK supports and tests in CI. On Bun 1.3, @sentry/bun does not instrument outgoing node:http requests. They get no sentry-trace or baggage headers and no spans, so traces break across services. Bun 1.4.0 and later work correctly.

We cannot fix this well on Bun 1.3. I suggest we drop Bun 1.3 in v12 and require Bun 1.4 or later.

Cause

  • Bun 1.3 does not publish the http.client.request.created diagnostics channel. Bun 1.4.0 does.
  • @sentry/node decides to use that channel from process.versions.node. Bun 1.3.14 reports Node 24.3.0, so the SDK subscribes to a channel that never fires.
  • The fallback in @sentry/core (client-patch.ts) wraps ClientRequest.prototype._storeHeader. Bun 1.3 uses another ClientRequest implementation that has no _storeHeader, so the fallback patches nothing.

Why a fix on Bun 1.3 is not practical

We tested these options on Bun 1.3.14:

  • Wrap ClientRequest.prototype.end: each request has its own write and end methods, so the request never calls the prototype hook. Also, a request with a streamed body sends its headers at the first write(), before end().
  • Wrap http.request and http.get on the module object: only code that calls through the default import or require('node:http') gets the wrapper. Named imports (import { request }) and namespace imports (import * as http) keep the original functions. http.get also does not call http.request internally, so the wrapper must rewrite the request options before the call.

A fix would be a Bun-1.3-only rewrite of the request options. Named and namespace imports would still not work.

What changes if we drop Bun 1.3

  • The minimum Bun version becomes 1.4: engines.bun in packages/bun/package.json (now >=1.3.14) and the docs.
  • The CI matrix drops 1.3.14 in job_bun_unit_tests and job_bun_integration_tests (.github/workflows/build.yml).
  • dev-packages/bun-integration-tests can remove the Bun < 1.4 excludes (BUN_BUILD_BEFORE_1_4_EXCLUDE, SENTRY_BUN_BEFORE_1_4_EXCLUDE) and BUN_BEFORE_1_4 in vite.config.mts. Those excludes also cover two other Bun 1.3 problems: CommonJS bundles of langchain and langgraph throw require_ai is not a function, and the proxy suite fails in the @sentry/bun alias preload.

Until then

On Bun 1.3, express/with-http/base is excluded in the bun-build project (#26611). Users on Bun 1.3 who need trace propagation for outgoing node:http requests should upgrade to Bun 1.4 or later.

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

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.