Skip to content

fix(server-utils): Stop orchestrion rollup plugin from crashing under Rolldown - #23545

Open
mkly wants to merge 1 commit into
getsentry:developfrom
mkly:mkly/fix/rolldown-error
Open

fix(server-utils): Stop orchestrion rollup plugin from crashing under Rolldown#23545
mkly wants to merge 1 commit into
getsentry:developfrom
mkly:mkly/fix/rolldown-error

Conversation

@mkly

@mkly mkly commented Aug 24, 2026

Copy link
Copy Markdown

fix(server-utils): Stop orchestrion rollup plugin from crashing under Rolldown

The plugin's buildStart hook assumed the bundler had normalized external into a predicate function by the time the hook runs. Rolldown deliberately omits function-typed options from its normalized options (rolldown/rolldown#1041), so rollupOptions.external is undefined there for every config shape and calling it crashed the build with "rollupOptions.external is not a function".

The plugin now captures the raw external value in the options hook, which both bundlers invoke with the un-normalized input options. buildStart keeps using the normalized predicate when the bundler provides one and probes the captured raw value otherwise, so the externalized-modules warning still fires on Rolldown for string, array, RegExp and function configs. String entries match via the shared externalEntryMatchesModule, consistent with the esbuild and webpack plugins.

Fixes #23450

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.

Closes #23450

… Rolldown

The plugin's `buildStart` hook assumed the bundler had normalized
`external` into a predicate function by the time the hook runs. Rolldown
deliberately omits function-typed options from its normalized options
(rolldown/rolldown#1041), so `rollupOptions.external` is `undefined`
there for every config shape and calling it crashed the build with
"rollupOptions.external is not a function".

The plugin now captures the raw `external` value in the `options` hook,
which both bundlers invoke with the un-normalized input options.
`buildStart` keeps using the normalized predicate when the bundler
provides one and probes the captured raw value otherwise, so the
externalized-modules warning still fires on Rolldown for string, array,
RegExp and function configs. String entries match via the shared
`externalEntryMatchesModule`, consistent with the esbuild and webpack
plugins.

Fixes getsentry#23450
@mkly
mkly requested a review from a team as a code owner August 24, 2026 17:28
@mkly
mkly requested review from msonnb and stephanie-anderson and removed request for a team August 24, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"rollupOptions.external is not a function" with rolldown using @sentry/node/rollup v11

1 participant