{"record":{"id":"ac312f6bb2acbfae","repo":"parcel-bundler/parcel","slug":"could-not-determine-version-of-pluginname-in","errorCode":null,"errorMessage":"Could not determine version of ${pluginName} in ${path.relative(process.cwd(), resolveFrom)}. Either include it in \"dependencies\" or \"parcelDependencies\".","messagePattern":"Could not determine version of (.+?) in (.+?)\\. Either include it in \"dependencies\" or \"parcelDependencies\"\\.","errorType":"exception","errorClass":"ThrowableDiagnostic","httpStatus":null,"severity":"error","filePath":"packages/core/core/src/loadParcelPlugin.js","lineNumber":92,"sourceCode":"      options.projectRoot,\n    );\n    if (\n      configPkg != null &&\n      configPkg.config.dependencies?.[pluginName] == null\n    ) {\n      // If not in the config's dependencies, the plugin will be auto installed with\n      // the version declared in \"parcelDependencies\".\n      range = configPkg.config.parcelDependencies?.[pluginName];\n      isOptional =\n        Array.isArray(configPkg.config.optionalParcelDependencies) &&\n        configPkg.config.optionalParcelDependencies.includes(pluginName);\n\n      if (range == null && !isOptional) {\n        let contents = await options.inputFS.readFile(\n          configPkg.files[0].filePath,\n          'utf8',\n        );\n        throw new ThrowableDiagnostic({\n          diagnostic: {\n            message: md`Could not determine version of ${pluginName} in ${path.relative(\n              process.cwd(),\n              resolveFrom,\n            )}. Either include it in \"dependencies\" or \"parcelDependencies\".`,\n            origin: '@parcel/core',\n            codeFrames:\n              configPkg.config.dependencies ||\n              configPkg.config.parcelDependencies\n                ? [\n                    {\n                      filePath: configPkg.files[0].filePath,\n                      language: 'json5',\n                      code: contents,\n                      codeHighlights: generateJSONCodeHighlights(contents, [\n                        {\n                          key: configPkg.config.parcelDependencies\n                            ? '/parcelDependencies'","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/core/core/src/loadParcelPlugin.js#L74-L110","documentation":"When Parcel auto-installs a plugin referenced by a config package, it needs a version range. It looks up the plugin name in the config package's `dependencies` and `parcelDependencies` (and `optionalParcelDependencies`). If none of these provide a range and the plugin isn't optional, Parcel cannot decide which version to install and reports the config file as the source.","triggerScenarios":"A config package references a plugin by name but its `package.json` omits that plugin from both `dependencies` and `parcelDependencies`.","commonSituations":"Authoring a config package and forgetting to declare the plugin dependency; adding a pipeline entry without updating package.json.","solutions":["Add the plugin to `parcelDependencies` (recommended for config packages) with a semver range.","Or add it to `dependencies` so it ships with the config package.","Re-run the build after editing package.json so the version is resolved."],"exampleFix":"// before (config package package.json)\n{ \"dependencies\": {} }\n\n// after\n{ \"parcelDependencies\": { \"@parcel/transformer-image\": \"^2.0.0\" } }","handlingStrategy":"validation","validationCode":"// Validate that every plugin referenced by the config is declared.\nconst declared = new Set([\n  ...Object.keys(pkg.dependencies ?? {}),\n  ...Object.keys(pkg.parcelDependencies ?? {}),\n]);\nfor (const p of referencedPlugins) {\n  if (!declared.has(p)) throw new Error(`declare ${p} in parcelDependencies`);\n}","typeGuard":"function isDeclaredPlugin(name: string, pkg: any): boolean {\n  return Boolean(\n    pkg.dependencies?.[name] ?? pkg.parcelDependencies?.[name],\n  );\n}","tryCatchPattern":null,"preventionTips":["Add every plugin to parcelDependencies when authoring a config package.","Run a config-lint step in CI that cross-checks .parcelrc vs package.json."],"tags":["config","plugin","versioning","packaging"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}