rollup
Rollup Error Codes
Diagnostic codes emitted by the Rollup JavaScript module bundler. Each code appears as the code property on a RollupError or RollupWarning and identifies the specific problem more precisely than the message string.
15 codes
· All codes 15 codes
- CIRCULAR_DEPENDENCY Circular Dependency A circular import chain was detected (e.g. A imports B imports A). Rollup can still bundle circular dependencies in many cases, but they may cause runtime issues — values can be undefined at the time of first access. Refactor to break the cycle or use dynamic imports.
- EMPTY_BUNDLE Empty Bundle The generated output bundle is empty because Rollup could not find any code to include after tree-shaking. Check that your entry point exports something and that it is not excluded by the external option.
- EVAL Use of eval The bundle contains a call to eval() or an indirect equivalent. eval() prevents Rollup from safely tree-shaking the module because it can reference any variable by name at runtime. Replace eval() with a safer alternative, or suppress this warning if the use is intentional.
- INVALID_OPTION Invalid Option A Rollup configuration option has an invalid value or type. Check the option named in the error message against the Rollup configuration reference and ensure the value matches the expected type.
- MISSING_EXPORT Missing Export A module imports a named binding that the source module does not export. This is a hard error at bundle time. Check the spelling of the import and verify the exporting module's public API.
- MISSING_GLOBAL_NAME Missing Global Name A module is marked as external but no global variable name was provided for it in the output.globals option. Rollup cannot generate valid UMD or IIFE output without knowing what global to reference. Add an entry to output.globals mapping the module id to its global name.
- MISSING_NODE_BUILTINS Missing Node Builtins The bundle imports Node.js built-in modules (such as fs, path, or crypto) but is targeting a browser environment. Mark these imports as external or provide browser-compatible polyfills via the plugins option.
- MODULE_LEVEL_DIRECTIVE Module Level Directive A 'use strict' or 'use client' directive was found after non-directive statements in a module. Directives must appear at the very top of a file or function body to take effect; Rollup warns when they are in an invalid position.
- NAMESPACE_CONFLICT Namespace Conflict Two modules export the same name and both are re-exported through a namespace wildcard (export * from '...'). Only one value can win. Resolve the conflict by explicitly re-exporting the desired binding or renaming one of them.
- PARSE_ERROR Parse Error Rollup failed to parse a module as valid JavaScript or TypeScript. Check the file for syntax errors. If the file uses a non-standard syntax (e.g. JSX, decorators), add the appropriate plugin such as @rollup/plugin-babel or @rollup/plugin-typescript.
- PLUGIN_ERROR Plugin Error A Rollup plugin threw an error during the build. The error message will include the plugin name and, where possible, the source file and line number. Check the plugin's configuration and ensure its peer dependencies are installed.
- SOURCEMAP_BROKEN Sourcemap Broken A plugin transformed a module but did not produce a valid source map to go with it, making Rollup unable to generate an accurate combined source map. Pass sourcemap: false to suppress the error, or fix the plugin to return a valid map from its transform hook.
- THIS_IS_UNDEFINED This Is Undefined A module uses this at the top level, but in ES module context this is undefined. Rollup replaces it with undefined in the output. If the code is CommonJS being converted to ESM, add @rollup/plugin-commonjs or suppress the warning for intentional top-level this references.
- UNRESOLVED_IMPORT Unresolved Import Rollup could not find the module referenced by an import statement. If the module is a third-party package, install it and add @rollup/plugin-node-resolve. If it should be treated as external (not bundled), add it to the external option.
- UNUSED_EXTERNAL_IMPORT Unused External Import A named import from an external module is never used in the bundle after tree-shaking. The import can be safely removed. This warning helps identify dead imports that inflate the dependency surface of the output.