Skip to content

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

Open
mkly wants to merge 3 commits 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 3 commits 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
@mydea
mydea requested review from andreiborza, isaacs and timfish and removed request for stephanie-anderson August 25, 2026 13:23

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mkly, thanks for fixing this!

@mkly

mkly commented Aug 25, 2026

Copy link
Copy Markdown
Author

Looks like test failures were possibly fixed in #23590 so I'll wait for further instructions on that. Thanks for taking a look. I appreciate it.

edit: I did a merge commit for visibility so tests will run with the fix. Can just squash on merge.

…n-error

# Conflicts:
#	packages/server-utils/src/orchestrion/bundler/rollup.ts
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

2 participants