parcel-bundler/parcel · error · ThrowableDiagnostic

Cannot find Parcel plugin "${pluginName}"

Error message

Cannot find Parcel plugin "${pluginName}"

What it means

Parcel could not resolve the named plugin module from the config's location. Before throwing, it queries `findAlternativeNodeModules` for similar names and attaches a code frame from the `.parcelrc`. This typically means a typo, a missing install, or a package not resolvable from the config's directory.

Source

Thrown at packages/core/core/src/loadParcelPlugin.js:152

        range,
      },
    ));
  } catch (err) {
    if (err.code !== 'MODULE_NOT_FOUND') {
      throw err;
    }

    if (isOptional) {
      return null;
    }

    let configContents = await options.inputFS.readFile(configPath, 'utf8');
    let alternatives = await findAlternativeNodeModules(
      options.inputFS,
      pluginName,
      path.dirname(resolveFrom),
    );
    throw new ThrowableDiagnostic({
      diagnostic: {
        message: md`Cannot find Parcel plugin "${pluginName}"`,
        origin: '@parcel/core',
        codeFrames: keyPath
          ? [
              {
                filePath: configPath,
                language: 'json5',
                code: configContents,
                codeHighlights: generateJSONCodeHighlights(configContents, [
                  {
                    key: keyPath,
                    type: 'value',
                    message: md`Cannot find module "${pluginName}"${
                      alternatives[0]
                        ? `, did you mean "${alternatives[0]}"?`
                        : ''
                    }`,

View on GitHub (pinned to 59484858a1)

Solutions

  1. Install the plugin: `npm install <plugin-name>` (or add to devDependencies).
  2. Check the spelling and npm scope against the suggested alternatives in the diagnostic.
  3. If the plugin is intentionally absent, mark it optional via `optionalParcelDependencies`.

Example fix

// before
$ npm run build  # Cannot find Parcel plugin "@parcrl/transformer-js"

// after
$ npm install -D @parcel/transformer-js
Defensive patterns

Strategy: validation

Validate before calling

// Pre-resolve the plugin from the config path before building.
try {
  await require.resolve(pluginName, {paths: [path.dirname(configPath)]});
} catch {
  throw new Error(`install ${pluginName} or fix the name`);
}

Type guard

async function isResolvable(name: string, from: string): Promise<boolean> {
  try { await require.resolve(name, {paths: [from]}); return true; }
  catch { return false; }
}

Prevention

When it happens

Trigger: A `.parcelrc`/config package references a plugin name that does not resolve via Node resolution from the config path, and the plugin is not optional.

Common situations: Misspelled plugin name; plugin is a devDependency that wasn't installed; wrong npm scope; resolvable from one workspace but not another.

Related errors


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