Skip to content

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

Description

@spaceemotion

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

v11 alpha 1

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  1. Install v11 alpha 1 of @sentry/node
  2. Import @sentry/node/rollup in a rolldown config and use the plugin
  3. Build

Expected Result

No problems - the previous separte rollup package worked fine (tested with v5.4.0)

Actual Result

ERROR  Build failed with 1 error:

[plugin code-transformer]
TypeError: rollupOptions.external is not a function
    at file://[redacted]/node_modules/.pnpm/@sentry+server-utils@11.0.0-alpha.1/node_modules/@sentry/server-utils/build/esm/orchestrion/bundler/rollup.js:29:78
    at Array.filter (<anonymous>)
    at PluginContextImpl.buildStart (file://[redacted]/node_modules/.pnpm/@sentry+server-utils@11.0.0-alpha.1/node_modules/@sentry/server-utils/build/esm/orchestrion/bundler/rollup.js:29:47)
    at plugin (file://[redacted]/node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/shared/bindingify-input-options-C-Zsy1EG.mjs:1444:17)
    at file://[redacted]/node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/shared/bindingify-input-options-C-Zsy1EG.mjs:1928:21
    at plugin.<computed> (file://[redacted]/node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/shared/bindingify-input-options-C-Zsy1EG.mjs:2125:18)

    at aggregateBindingErrorsIntoJsError ([redacted]/node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/shared/error-CVc7IgvG.mjs:48:18)
    at unwrapBindingResult ([redacted]/node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/shared/error-CVc7IgvG.mjs:18:128)
    at #build ([redacted]/node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/shared/rolldown-DiYVDns9.mjs:132:34)
    at async bundleInner ([redacted]/node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/cli.mjs:1023:49)
    at async bundleWithConfig ([redacted]/node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/cli.mjs:938:7)
    at async main ([redacted]/node_modules/.pnpm/rolldown@1.2.4/node_modules/rolldown/dist/cli.mjs:1194:3)

Additional Context

import { defineConfig } from 'rolldown';
import { sentryRollupPlugin } from '@sentry/node/rollup';

export default defineConfig({
  // ...
  plugins: [
    // ...
    sentryRollupPlugin({
      disable: !process.env.SENTRY_AUTH_TOKEN,
      telemetry: false,

      authToken: process.env.SENTRY_AUTH_TOKEN,
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,

      release: {
        dist: process.env.SENTRY_DIST,
        setCommits: {
          auto: true,
          ignoreEmpty: true,
          ignoreMissing: true,
        },
      },

      bundleSizeOptimizations: {
        excludeDebugStatements: process.env.SENTRY_ENVIRONMENT === 'production' || process.env.APP_ENV === 'production',
        excludeReplayShadowDom: true,
        excludeReplayIframe: true,
        excludeReplayWorker: true,
      },
    }),
  ],
});

Priority

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

No one assigned

    Projects

    Status
    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions