getsentry / getsentry/sentry-javascript

@sentry/bun throws "TypeError: Cannot replace module namespace object's binding with configurable attribute"

Đang mở
#12,891 17 bình luận 12 reaction 0 người được giao Xem trên GitHub
Bug Bun External Dependency State: Blocked
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
515

Mô tả

### Is there an existing issue for this?

- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- [X] I have reviewed the documentation https://docs.sentry.io/
- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

### How do you use Sentry?

Sentry Saas (sentry.io)

### Which SDK are you using?

@sentry/bun

### SDK Version

8.17.0

### Framework Version

Bun 1.1.18

### Link to Sentry event

https://reserve-sense.sentry.io/issues/5597727361/?project=4506890995499008

### SDK Setup/Reproduction Example

```
import { init } from '@sentry/bun';

init({
dsn: '__MY_DSN__',
tracesSampleRate: 0.5,
});
```

### Steps to Reproduce

I'm adding Sentry to my Bun API and I simply added a basic `init()` call at the start of my server and it immediately crashes with the error below.

I'm using `node-file-router` and looks like combining it with the `init()` call causes issues. My code for that is:

```
import { initFileRouter } from 'node-file-router';
const runFileRouter = await initFileRouter({
ignoreFilesRegex: [/.\.test/],
});
```

### Expected Result

No failure

### Actual Result

App crashes with:

```
9 |
10 | // Sets a property on an object, preserving its enumerability.
11 | // This function assumes that the property is already writable.
12 | function defineProperty (obj, name, value) {
13 | var enumerable = !!obj[name] && obj.propertyIsEnumerable(name)
14 | Object.defineProperty(obj, name, {
^
TypeError: Cannot replace module namespace object's binding with configurable attribute
at defineProperty (native:1:1)
at defineProperty (/myproject/node_modules/.pnpm/shimmer@1.2.1/node_modules/shimmer/index.js:14:10)
at wrap (/myproject/node_modules/.pnpm/shimmer@1.2.1/node_modules/shimmer/index.js:74:3)
at /myproject/node_modules/.pnpm/@opentelemetry+instrumentation-http@0.52.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/instrumentation-http/build/src/http.js:78:13
at /myproject/node_modules/.pnpm/@opentelemetry+instrumentation@0.52.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/instrumentation/build/src/platform/node/RequireInTheMiddleSingleton.js:67:27
at /myproject/node_modules/.pnpm/require-in-the-middle@7.3.0/node_modules/require-in-the-middle/index.js:281:28
at /myproject/node_modules/.pnpm/@smithy+node-http-handler@3.1.2/node_modules/@smithy/node-http-handler/dist-cjs/index.js:150:3
at anonymous (native:1:1)
at /myproject/node_modules/.pnpm/require-in-the-middle@7.3.0/node_modules/require-in-the-middle/index.js:295:32
at /myproject/node_modules/.pnpm/@smithy+util-stream@3.0.6/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js:4:1
```

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

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

Đánh giá

Issue này chưa được đánh giá.

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.