Repository navigation
feat(nextjs): Use the Bun integrations when Next.js runs on Bun - #26294
Merged
JPeer264 merged 1 commit intoNov 13, 2026
Merged
Conversation
Contributor
size-limit report 📦Compared: d56b709 (PR test merge using develop at 93bc7af) Against: 621a801 (develop) · base run #65856
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 4 not successful, 56 successful. See the run.
Successful checks
|
JPeer264
commented
Nov 11, 2026
| // Error should carry the parameterized transaction name | ||
| expect(errorEvent.transaction).toBe('GET /route-handler/[xoxo]/error'); | ||
| // `@sentry/nextjs` has no Deno entry, so Deno runs the Node.js entry. | ||
| expect(errorEvent.contexts?.runtime?.name).toBe(getRuntime() === 'deno' ? 'node' : getRuntime()); |
Member
Author
There was a problem hiding this comment.
This is getting removed in the next stack PR where Deno is being introduced
JPeer264
force-pushed
the
jp/nextjs-bun-entry
branch
from
November 11, 2026 15:09
ed8bd58 to
fc478d5
Compare
JPeer264
marked this pull request as ready for review
November 11, 2026 15:13
JPeer264
requested review from
chargome and
isaacs
and removed request for
msonnb
November 11, 2026 15:13
isaacs
force-pushed
the
jp/nextjs-bun-entry
branch
from
November 12, 2026 10:25
fc478d5 to
1f5e3a1
Compare
isaacs
force-pushed
the
jp/nextjs-bun-entry
branch
from
November 12, 2026 11:19
1f5e3a1 to
4999ca9
Compare
Adds a `bun` export condition. Its `init` replaces the undici fetch integration with the fetch integration of `@sentry/bun`, adds `bunHttpServerIntegration` to isolate requests, and reports Bun as the runtime. `@sentry/bun` is an optional peer dependency. Next.js bundles `@sentry/nextjs` without the `bun` condition, so `withSentryConfig` makes it external when the build runs on Bun. The Bun variant of the nextjs-16 e2e app now builds with `bun --bun next build` and does not add the Bun integrations by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/nextjs-bun-entry
branch
from
November 12, 2026 13:28
4999ca9 to
fda8b80
Compare
1 of 6 tasks
51 tasks done
JPeer264
added a commit
to getsentry/sentry-docs
that referenced
this pull request
Nov 18, 2026
<!-- Keep the urgency section so automation can prioritize this PR. You may delete other sections you don't need. --> ## DESCRIBE YOUR PR follow up to getsentry/sentry-javascript#26294 follow up to getsentry/sentry-javascript#26295 This adds setup pages for Next.js apps that build and run with Bun or Deno. They are below Manual Setup next to Cloudflare, and the Bun and Deno framework selectors link to them. The pages show the `@sentry/bun` and `@sentry/deno` packages that the Next.js SDK needs on these runtimes, and the start commands `bun --bun next start` and `deno run -A --conditions=deno npm:next start`. The parts that the Cloudflare, Bun and Deno pages share move to `includes/nextjs/`. Pages Router and Webpack Setup move below the runtime pages in the sidebar. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the due date. You can update this information later by editing the PR description. - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've supplied a deadline. Thanks in advance for your help! ## PRE-MERGE CHECKLIST _Make sure you've checked the following before merging your changes:_ - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
part of #24830
part of JS-3835
This adds a
bunexport condition to@sentry/nextjs. On Bun,initadds the fetch integration andbunHttpServerIntegrationof@sentry/bunand reports Bun as the runtime. Whennext buildruns on Bun,withSentryConfigmakes@sentry/nextjsexternal, so Bun resolves it at run time and loads this entry.@sentry/bunis an optional peer dependency:Why
Without these integrations, all requests on Bun shared one trace and outgoing
fetchcalls had no spans, unless users added them by hand.CI decisions
The e2e jobs now use Bun 1.4.2, not 1.3.14. Bun 1.3 crashes in the Turbopack build when
applicationKeyis set. The alternative is a Bun version for each e2e variant.Known issues
@sentry/nextjs, so vinext apps on Bun must add it to therscexternals of Vite.@sentry/buninstalled, an app that loads the Bun entry fails at start.