Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

@sentry/bundler-plugins pulls @sentry/cli into consumers that only import ./babel-plugin

Đang mở
#24,606 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
nodejs, typescript

Hướng nghiên cứu

Start with the @sentry/bundler-plugins ./babel-plugin entry point and its component-annotation.js, constants.js, and experimental.js dependencies. Inspect how @sentry/cli is declared and which bundler integrations invoke it. Done means importing only ./babel-plugin no longer installs a duplicate release-upload CLI, while integrations that use the CLI still work; verify with a clean package-manager install and relevant tests.

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

Mô tả

React-Native Waiting for: Product Owner
Summary

@sentry/bundler-plugins declares @sentry/cli as a hard dependency. Consumers that only import the ./babel-plugin entry point pay for a full sentry-cli install, including its platform binary, even though that entry point never invokes the CLI.

Impact

@sentry/react-native 8.21.0 migrated from @sentry/babel-plugin-component-annotate to @sentry/bundler-plugins/babel-plugin (getsentry/sentry-react-native#6501), because the old package is no longer published. It has exactly one import of the package:

// @sentry/react-native/dist/js/tools/sentryBabelTransformerUtils.js
const babel_plugin_1 = require("@sentry/bundler-plugins/babel-plugin");

The ./babel-plugin CJS entry is 20 KB and requires only ./component-annotation.js, ./constants.js and ./experimental.js. It never reaches sentry-cli.

Because @sentry/react-native 8.24.0 pins "@sentry/cli": "3.6.2" while @sentry/bundler-plugins 10.71.0 declares "@sentry/cli": "^2.58.6", package managers install two majors side by side. Measured in a real React Native app on macOS arm64 (Yarn 1.22.22):

Size
@sentry/cli-darwin@3.6.2 (hoisted) 27 MB
@sentry/cli-darwin@2.58.6 (nested under @sentry/bundler-plugins) 35 MB
  • node_modules grew ~36 MB on the 8.18.0 -> 8.24.0 upgrade
  • yarn.lock grew 98 net lines, roughly 72 of which are the duplicated @sentry/cli entry plus its eight platform packages

Every clean CI install now downloads both binaries.

Expected

Importing a babel plugin should not install a release-upload CLI.

Suggested fix

Any one of:

  • publish the component-annotate babel plugin as a standalone package again
  • move @sentry/cli to an optional or peer dependency, so only the bundler integrations that actually shell out to it require it
  • split the package so ./babel-plugin resolves without the upload machinery
Workaround

A package manager override pinning @sentry/cli to the version the SDK already uses:

"resolutions": { "@sentry/cli": "3.6.2" }

This removes the duplicate and reduces the lockfile growth from +98 to +26 lines, with no observed breakage, since the babel-plugin path never reaches the CLI.

Versions
  • @sentry/bundler-plugins: 10.71.0
  • @sentry/react-native: 8.24.0
  • react-native: 0.83.10
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.9k
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
576

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.