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
- Install the plugin: `npm install <plugin-name>` (or add to devDependencies).
- Check the spelling and npm scope against the suggested alternatives in the diagnostic.
- 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
- Install plugins as devDependencies in the same workspace as the config.
- Double-check the npm scope and spelling.
- Use the suggested alternatives in the diagnostic when unsure.
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
- Local plugins are not supported in Parcel config packages. P
- Bundle is not inline and unable to retrieve contents
- Only one spread parameter can be included in a config pipeli
- Asset has an AST but no generate method is available on the
- ${pluginName} does not have a generate method
AI-assisted analysis of parcel-bundler/parcel@59484858a1 (2026-08-13).
Data as JSON: /api/errors/5c3bc8faccff4d01.
Report an issue: GitHub.