-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- 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
10.10.0
Framework Version
Bun 1.2.21
Link to Sentry event
No response
Reproduction Example/SDK Setup
Bun fails to build @sentry/bun
in cjs format with the error TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun
Steps to Reproduce
- Create
src/index.ts
with the following after installing@sentry/bun
import * as Sentry from '@sentry/bun'
- Bundle
bun build ./src/index.ts --outdir dist --format cjs --target bun --sourcemap
- Try to run run the bundle
bun ./dist/index.js
Expected Result
Should run
Actual Result
bun ./dist/index.js
6 | "use strict";
7 |
8 | //
9 | if (entry.instantiate)
10 | return entry.instantiate;
11 | var instantiatePromise = (async () => {
^
TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun
Bun v1.2.21 (macOS arm64)
Additional Context
Workaround: Add --external @sentry/node
to fix the issue.
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1
or me too
, to help us triage it.
Metadata
Metadata
Assignees
Projects
Status
Waiting for: Product Owner