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

  1. 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.
  2. If extending the default config, verify your extends field is correct and not accidentally replacing the namers section.
  3. Check that @parcel/namer-default is installed: npm ls @parcel/namer-default.
  4. If writing a custom namer plugin, ensure it returns a string name for at least the bundle types in your project.
  5. 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

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


AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13). Data as JSON: /api/errors/0f56a9f0f0ac5680. Report an issue: GitHub.