{"record":{"id":"3dbcbcede4c99fa8","repo":"rolldown/rolldown","slug":"plugin-error","errorCode":"PLUGIN_ERROR","errorMessage":"PLUGIN_ERROR","messagePattern":"PLUGIN_ERROR","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/rolldown/src/plugin/minimal-plugin-context.ts","lineNumber":56,"sourceCode":"  /**\n   * Whether Rolldown was started via {@linkcode watch | rolldown.watch()} or\n   * from the command line with `--watch`.\n   */\n  watchMode: boolean;\n}\n\n/** @category Plugin APIs */\nexport interface MinimalPluginContext {\n  /**\n   * Similar to {@linkcode warn | this.warn}, except that it will also abort\n   * the bundling process with an error.\n   *\n   * If an Error instance is passed, it will be used as-is, otherwise a new Error\n   * instance will be created with the given error message and all additional\n   * provided properties.\n   *\n   * In all hooks except the {@linkcode Plugin.onLog | onLog} hook, the error will\n   * be augmented with {@linkcode RolldownLog.code | code: \"PLUGIN_ERROR\"} and\n   * {@linkcode RolldownLog.plugin | plugin: plugin.name} properties.\n   * If a `code` property already exists and the code does not start with `PLUGIN_`,\n   * it will be renamed to {@linkcode RolldownLog.pluginCode | pluginCode}.\n   *\n   * @group Logging Methods\n   */\n  error: (e: RolldownError | string) => never;\n  /**\n   * Generate a `\"info\"` level log.\n   *\n   * {@linkcode RolldownLog.code | code} will be set to `\"PLUGIN_LOG\"` by Rolldown.\n   * As these logs are displayed by default, use them for information that is not a warning\n   * but makes sense to display to all users on every build.\n   *\n   * {@include ./docs/plugin-context-info.md}\n   *\n   * @inlineType LoggingFunction\n   * @group Logging Methods","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/rolldown/rolldown/blob/91b44b9d7bcfb5725533478e044e3891a251b2c5/packages/rolldown/src/plugin/minimal-plugin-context.ts#L38-L74","documentation":"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.","triggerScenarios":"Thrown at packages/rolldown/src/plugin/minimal-plugin-context.ts:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the reported error message and plugin/hook location, then fix the plugin's logic or its input","Validate inputs inside the plugin and use this.warn for non-fatal issues instead of this.error","Update third-party plugins incompatible with the current rolldown version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"91b44b9d7bcfb5725533478e044e3891a251b2c5","analyzedAt":"2026-09-07T16:04:13.504Z","contentChangedAt":"2026-09-07T16:04:13.504Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}