parcel-bundler/parcel · error · Error
Unable to name bundle
Error message
Unable to name bundle
What it means
Thrown by nameBundle() after iterating through every configured namer plugin and none returned a non-null name for the bundle. Each namer's plugin.name() is called in order; if all return undefined/null, the loop exhausts and the bare Error is thrown. This indicates a missing or misconfigured namer plugin in the Parcel config.
Source
Thrown at packages/core/core/src/requests/BundleGraphRequest.js:542
let {hashReference} = internalBundle;
internalBundle.displayName = name.includes(hashReference)
? name.replace(hashReference, '[hash]')
: name;
return;
}
} catch (e) {
throw new ThrowableDiagnostic({
diagnostic: errorToDiagnostic(e, {
origin: namer.name,
}),
});
} finally {
measurement && measurement.end();
}
}
throw new Error('Unable to name bundle');
}
}
View on GitHub (pinned to 59484858a1)
Solutions
- Ensure your .parcelrc includes a namer — the default config provides @parcel/namer-default; if you have a custom .parcelrc, add it to the namers array.
- If extending the default config, verify your extends field is correct and not accidentally replacing the namers section.
- Check that @parcel/namer-default is installed: npm ls @parcel/namer-default.
- If writing a custom namer plugin, ensure it returns a string name for at least the bundle types in your project.
- Remove .parcelrc temporarily to let Parcel use its built-in default config and confirm the error disappears.
Example fix
// before — .parcelrc with no namers
{
"extends": "@parcel/config-default",
"namers": []
}
// after — remove the override or include the default namer
{
"extends": "@parcel/config-default"
} Defensive patterns
Strategy: validation
Validate before calling
const fs = require('fs');
function validateNamerConfig(parcelrcPath) {
const cfg = JSON.parse(fs.readFileSync(parcelrcPath, 'utf8'));
if (cfg.namers !== undefined && (!Array.isArray(cfg.namers) || cfg.namers.length === 0)) {
throw new Error('.parcelrc has an empty or invalid namers array — at least one namer is required.');
}
} Prevention
- Always extend @parcel/config-default unless you have a specific reason not to.
- If customizing namers, include @parcel/namer-default as the last entry.
- Verify @parcel/namer-default is installed when using a custom .parcelrc.
When it happens
Trigger: Reached at the end of the for (let namer of namers) loop in nameBundle(). Every namer.plugin.name({...}) call returned null/undefined, so internalBundle.name was never set. The namers array comes from the Parcel config's namers pipeline.
Common situations: Using a custom .parcelrc that omits the default namer (@parcel/namer-default); a namer plugin that has a bug causing it to always return null; targeting an environment the default namer doesn't handle; upgrading Parcel and the default config changed so no namer is loaded.
Related errors
- Only one spread parameter can be included in a config pipeli
- Local plugins are not supported in Parcel config packages. P
- Cannot find Parcel plugin "${pluginName}"
- 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/0f56a9f0f0ac5680.
Report an issue: GitHub.