rolldown/rolldown · error

PLUGIN_ERROR

PLUGIN_ERROR

Error message

PLUGIN_ERROR

What it means

Not a thrown error: 'PLUGIN_ERROR' is a log/error code used by the plugin context's error-reporting path (this.error / MinimalPluginContext). When a plugin hook rejects or calls this.error, the build logs the failure under this code with the originating plugin and hook attached, aborting the bundling process.

Solutions

  1. Read the reported error message and plugin/hook location, then fix the plugin's logic or its input
  2. Validate inputs inside the plugin and use this.warn for non-fatal issues instead of this.error
  3. Update third-party plugins incompatible with the current rolldown version
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at packages/rolldown/src/plugin/minimal-plugin-context.ts:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of rolldown/rolldown@91b44b9d7b (2026-09-07). Data as JSON: /api/errors/3dbcbcede4c99fa8. Report an issue: GitHub.

Appendix: source

Thrown at packages/rolldown/src/plugin/minimal-plugin-context.ts:56

  /**
   * Whether Rolldown was started via {@linkcode watch | rolldown.watch()} or
   * from the command line with `--watch`.
   */
  watchMode: boolean;
}

/** @category Plugin APIs */
export interface MinimalPluginContext {
  /**
   * Similar to {@linkcode warn | this.warn}, except that it will also abort
   * the bundling process with an error.
   *
   * If an Error instance is passed, it will be used as-is, otherwise a new Error
   * instance will be created with the given error message and all additional
   * provided properties.
   *
   * In all hooks except the {@linkcode Plugin.onLog | onLog} hook, the error will
   * be augmented with {@linkcode RolldownLog.code | code: "PLUGIN_ERROR"} and
   * {@linkcode RolldownLog.plugin | plugin: plugin.name} properties.
   * If a `code` property already exists and the code does not start with `PLUGIN_`,
   * it will be renamed to {@linkcode RolldownLog.pluginCode | pluginCode}.
   *
   * @group Logging Methods
   */
  error: (e: RolldownError | string) => never;
  /**
   * Generate a `"info"` level log.
   *
   * {@linkcode RolldownLog.code | code} will be set to `"PLUGIN_LOG"` by Rolldown.
   * As these logs are displayed by default, use them for information that is not a warning
   * but makes sense to display to all users on every build.
   *
   * {@include ./docs/plugin-context-info.md}
   *
   * @inlineType LoggingFunction
   * @group Logging Methods

View on GitHub (pinned to 91b44b9d7b)