{"record":{"id":"1ce4cba3115bf0d0","repo":"vercel-labs/agent-skills","slug":"project-scope-unresolved","errorCode":"PROJECT_SCOPE_UNRESOLVED","errorMessage":"PROJECT_SCOPE_UNRESOLVED: the project was resolved without an owner account. Ask the user which Vercel team or personal scope owns the project, then rerun from a linked app directory or set VERCEL_PROJECT_ID with VERCEL_ORG_ID for that scope.","messagePattern":"PROJECT_SCOPE_UNRESOLVED: the project was resolved without an owner account\\. Ask the user which Vercel team or personal scope owns the project, then rerun from a linked app directory or set VERCEL_PROJECT_ID with VERCEL_ORG_ID for that scope\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/vercel-optimize/scripts/collect-signals.mjs","lineNumber":79,"sourceCode":"  log('checking Vercel CLI version…');\n  const cli = await checkCliVersion();\n  log(`vercel CLI v${cli.join('.')} OK`);\n\n  log('checking auth…');\n  await checkAuth();\n  log('auth OK');\n\n  log('resolving project id…');\n  const project = await resolveProjectId(explicitProjectId);\n  if (!project) {\n    throw new Error(\n      'NO_PROJECT_ID: pass one as argv, set VERCEL_PROJECT_ID, or run `vercel link` in this directory.'\n    );\n  }\n  log(`project link resolved (source=${project.source}; teamScope=${project.orgId ? 'yes' : 'no'})`);\n\n  if (!project.orgId) {\n    throw new Error('PROJECT_SCOPE_UNRESOLVED: the project was resolved without an owner account. Ask the user which Vercel team or personal scope owns the project, then rerun from a linked app directory or set VERCEL_PROJECT_ID with VERCEL_ORG_ID for that scope.');\n  }\n\n  log('checking framework support…');\n  const stack = await detectStack();\n  const frameworkSupport = classifyFrameworkSupport(stack);\n  log(`framework=${stack.framework}@${stack.frameworkVersion ?? '?'} support=${frameworkSupport.status}`);\n\n  if (!frameworkSupport.ok && !continueUnsupportedFramework) {\n    writeOutput({\n      schemaVersion: SCHEMA_VERSION,\n      collectedAt: new Date().toISOString(),\n      timeWindow: TIME_WINDOW,\n      projectId: project.projectId,\n      orgId: project.orgId,\n      projectIdSource: project.source,\n      commandScope: null,\n      frameworkSupport,\n      frameworkSupportBlocker: frameworkSupport.blocker,","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/vercel-labs/agent-skills/blob/b8caa260a420a73042e35521de4b5c8baf6446cc/skills/vercel-optimize/scripts/collect-signals.mjs#L61-L97","documentation":"Thrown by main() when resolveProjectId returned a project object but its orgId is null/falsy. The collector needs an owner account to scope every metrics/usage/contract call, so a project resolved without an owner is unusable. This happens when the project id is known but the owning team/user could not be determined from link files or env.","triggerScenarios":"explicit projectId passed (positional or VERCEL_PROJECT_ID) with no VERCEL_ORG_ID and readLinkedOwnerForProjectId returned null (no matching repo.json/project.json entry with an orgId); legacy project.json present but its orgId field is empty.","commonSituations":"CI sets VERCEL_PROJECT_ID but forgets VERCEL_ORG_ID; a linked project.json missing the orgId field; running in a dir where the link file has the id but not the owner.","solutions":["Set VERCEL_ORG_ID to the owning team (`team_…`) or user (`usr_…`) id for that project.","Re-link from the app directory so project.json/repo.json records both projectId and orgId.","Confirm with the user which Vercel team/personal scope owns the project, then rerun with both ids set."],"exampleFix":"# before\n$ VERCEL_PROJECT_ID=prj_xxx node scripts/collect-signals.mjs\n-> PROJECT_SCOPE_UNRESOLVED: resolved without an owner account.\n\n# after — supply the owner\n$ VERCEL_PROJECT_ID=prj_xxx VERCEL_ORG_ID=team_yyy node scripts/collect-signals.mjs","handlingStrategy":"validation","validationCode":"async function assertProjectHasOwner(explicit) {\n  const project = await resolveProjectId(explicit);\n  if (!project) throw new Error('NO_PROJECT_ID');\n  if (!project.orgId) {\n    throw new Error('Project resolved without owner; set VERCEL_ORG_ID for the owning team/user');\n  }\n  return project;\n}\nconst project = await assertProjectHasOwner(explicitProjectId);","typeGuard":"function hasOwnerScope(project) {\n  return !!project && typeof project.projectId === 'string' && !!project.orgId;\n}","tryCatchPattern":null,"preventionTips":["Always set VERCEL_ORG_ID alongside VERCEL_PROJECT_ID.","Re-link from the app dir so project.json records both ids.","Validate the link file contains orgId after `vercel link`."],"tags":["scope","config","environment","vercel"],"backgroundTag":null,"analyzedSha":"b8caa260a420a73042e35521de4b5c8baf6446cc","analyzedAt":"2026-08-13T06:03:29.508Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}