{"record":{"id":"842c28cb1d31e465","repo":"pnpm/pnpm","slug":"versioning-unknown-package-842c28","errorCode":"VERSIONING_UNKNOWN_PACKAGE","errorMessage":"Change intent file ${intent.filePath} names ${ref}, which is not a package in this workspace","messagePattern":"Change intent file (.+?) names (.+?), which is not a package in this workspace","errorType":"exception","errorClass":"PnpmError","httpStatus":null,"severity":"error","filePath":"pnpm11/releasing/versioning/src/assembleReleasePlan.ts","lineNumber":639,"sourceCode":"/**\n * Resolves every intent's package references to participant directories,\n * validating along the way: unknown references and names matching several\n * projects are hard errors, and a release can only be demanded from a\n * participant — otherwise the intent could never be consumed and the file\n * would linger forever. A `none` decline is fine for any workspace package.\n */\nfunction resolveIntents (\n  intents: ChangeIntent[],\n  refs: ProjectRefIndex,\n  participants: Map<string, Participant>\n): Map<string, Map<string, IntentBumpType>> {\n  const intentBumps = new Map<string, Map<string, IntentBumpType>>()\n  for (const intent of intents) {\n    const byDir = new Map<string, IntentBumpType>()\n    for (const [ref, bumpType] of Object.entries(intent.releases)) {\n      const dirs = refs.refToDirs(ref)\n      if (dirs.length === 0) {\n        throw new PnpmError('VERSIONING_UNKNOWN_PACKAGE', `Change intent file ${intent.filePath} names ${ref}, which is not a package in this workspace`)\n      }\n      if (dirs.length > 1) {\n        throw new PnpmError(\n          'VERSIONING_AMBIGUOUS_PACKAGE',\n          `Change intent file ${intent.filePath} names ${ref}, which matches multiple workspace projects: ${dirs.map((dir) => `./${dir}`).join(', ')}. ` +\n          'Reference the project by directory instead, e.g. \"./' + dirs[0] + '\": ' + bumpType\n        )\n      }\n      const dir = dirs[0]\n      if (bumpType !== 'none' && !participants.has(dir)) {\n        throw new PnpmError(\n          'VERSIONING_UNRELEASABLE_PACKAGE',\n          `Change intent file ${intent.filePath} requests a ${bumpType} release of ${ref}, which cannot release ` +\n          '(it is listed in versioning.ignore, has no version field, or has a non-semver version). ' +\n          'Remove the entry or change it to \"none\".'\n        )\n      }\n      const existing = byDir.get(dir)","sourceCodeStart":621,"sourceCodeEnd":657,"githubUrl":"https://github.com/pnpm/pnpm/blob/6261b7f388016d57ca6b90340342411cd1d0d00f/pnpm11/releasing/versioning/src/assembleReleasePlan.ts#L621-L657","documentation":"Change intent files (.changeset/*.md) drive pnpm's native versioning; their YAML frontmatter maps package references (package name or ./directory) to bump types. During plan assembly resolveIntents resolves every reference through the project ref index and throws VERSIONING_UNKNOWN_PACKAGE when a reference matches zero workspace projects — a release plan cannot be built from a name the engine cannot attribute.","triggerScenarios":"An intent file whose frontmatter contains a key that is neither a workspace package's name nor a ./directory of a workspace project: a typo ('@scope/errr'), a package that was removed or renamed after the intent was written, or a directory outside the workspace globs.","commonSituations":"Hand-written intent files with misspelled package names; intents left in .changeset/ after a package was deleted or renamed; referencing a package that exists only in a different workspace/branch.","solutions":["Fix the reference: use the exact name from the package's package.json, or the ./workspace-relative directory form","If the package no longer exists, delete or edit the stale .changeset/*.md file named in the message","Regenerate the intent with `pnpm change`, which only offers real workspace packages"],"exampleFix":"# .changeset/loud-moose.md — before\n---\n\"@scope/widgts\": patch\n---\nFix rendering glitch\n\n# after\n---\n\"@scope/widgets\": patch\n---\nFix rendering glitch","handlingStrategy":"validation","validationCode":"import glob from 'fast-glob'\nimport { readFile } from 'node:fs/promises'\n\n// Validate intent files against real workspace packages before committing them.\nexport async function assertIntentsNameRealPackages (workspaceDir: string, names: Set<string>, dirs: Set<string>): Promise<void> {\n  const files = await glob(['*.md'], { cwd: `${workspaceDir}/.changeset`, ignore: ['readme.md'] })\n  for (const file of files) {\n    const content = await readFile(`${workspaceDir}/.changeset/${file}`, 'utf8')\n    const m = content.match(/^---\\n([\\s\\S]*?)\\n---/)\n    if (m == null) continue\n    for (const line of m[1].split('\\n')) {\n      const ref = JSON.parse(`\"${line.slice(0, line.indexOf(':')).trim()}\"`)\n      const ok = ref.startsWith('./') ? dirs.has(ref.slice(2)) : names.has(ref)\n      if (!ok) throw new Error(`${file} references unknown package ${ref}`)\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await assembleReleasePlan(opts)\n} catch (err) {\n  if (err instanceof PnpmError && err.code === 'VERSIONING_UNKNOWN_PACKAGE') {\n    // The message names the intent file and the bad reference; fix or delete the file\n    throw new Error(`Bad change intent: ${err.message}`)\n  }\n  throw err\n}","preventionTips":["Generate intents with `pnpm change` instead of hand-writing files — it only offers real packages","Run an intent-lint step in CI that checks every frontmatter key against the current project list","Clean up .changeset/ intents in the same PR that removes or renames a package"],"tags":["versioning","change-intent","changeset","workspace"],"backgroundTag":"unknown-package-ref","analyzedSha":"6261b7f388016d57ca6b90340342411cd1d0d00f","analyzedAt":"2026-08-17T18:30:54.750Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}