parcel-bundler/parcel · error · Error
Only one spread parameter can be included in a config pipeli
Error message
Only one spread parameter can be included in a config pipeline
What it means
In `.parcelrc` pipeline extension, `...` means 'splice the inherited pipeline here'. Parcel flattens nested pipelines by substituting one spread with the parent's flattened pipeline. After substitution it checks for any remaining `...`; a second spread would be ambiguous (which parent? which order?) and is therefore rejected.
Source
Thrown at packages/core/core/src/ParcelConfig.js:431
for (let pattern in globMap) {
if (this.isGlobMatch(filePath, pattern)) {
matches.push(globMap[pattern]);
}
}
let flatten = () => {
let pipeline = matches.shift() || [];
let spreadIndex = pipeline.indexOf('...');
if (spreadIndex >= 0) {
pipeline = [
...pipeline.slice(0, spreadIndex),
...flatten(),
...pipeline.slice(spreadIndex + 1),
];
}
if (pipeline.includes('...')) {
throw new Error(
'Only one spread parameter can be included in a config pipeline',
);
}
return pipeline;
};
let res = flatten();
// $FlowFixMe afaik this should work
return res;
}
async missingPluginError(
plugins:
| GlobMap<ExtendableParcelConfigPipeline>
| GlobMap<ParcelPluginNode>
| PureParcelConfigPipeline,
message: string,View on GitHub (pinned to 59484858a1)
Solutions
- Use exactly one `...` per pipeline and position other transforms around it to control order.
- If you need pre- and post-inherited transforms, restructure as nested extended configs.
- Inspect the effective pipeline with `parcel show-config` to confirm there is a single spread.
Example fix
// before (.parcelrc)
{
"transforms": {
"*.js": ["pre-transform", "...", "post-transform", "..."]
}
}
// after
{
"transforms": {
"*.js": ["pre-transform", "...", "post-transform"]
}
} Defensive patterns
Strategy: validation
Validate before calling
// Reject configs with more than one spread before running.
function countSpreads(pipeline: string[]): number {
return pipeline.filter(s => s === '...').length;
}
if (pipeline.some(countSpreads > 1)) throw new Error('multiple spreads'); Type guard
function hasSingleSpread(pipeline: string[]): boolean {
return pipeline.filter(s => s === '...').length <= 1;
} Prevention
- Lint .parcelrc to forbid duplicate `...` entries.
- Validate extended configs with `parcel show-config` before building.
When it happens
Trigger: Authoring a `.parcelrc` pipeline (or extended config package) whose pipeline array contains two or more `...` entries.
Common situations: Extending a shared config and trying to inject transforms both before and after inheritance using two spreads.
Related errors
- Named pipeline '${k.slice(0, i + 1)}' is reserved.
- Only one spread element can be included in a config pipeline
- Local plugins are not supported in Parcel config packages. P
- Could not find a .parcelrc
- Could not find parcel config at ${path.relative(options.proj
AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13).
Data as JSON: /api/errors/3401456938170594.
Report an issue: GitHub.