{"record":{"id":"83e93e7bc2afbb7d","repo":"vercel-labs/agent-skills","slug":"no-project-id","errorCode":"NO_PROJECT_ID","errorMessage":"NO_PROJECT_ID: pass one as argv, set VERCEL_PROJECT_ID, or run `vercel link` in this directory.","messagePattern":"NO_PROJECT_ID: pass one as argv, set VERCEL_PROJECT_ID, or run `vercel link` in this directory\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"skills/vercel-optimize/scripts/collect-signals.mjs","lineNumber":72,"sourceCode":"\n  return { explicitProjectId, continueWithoutObservability, continueUnsupportedFramework };\n}\n\nasync function main() {\n  const { explicitProjectId, continueWithoutObservability, continueUnsupportedFramework } = parseArgs(process.argv.slice(2));\n\n  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(),","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/vercel-labs/agent-skills/blob/b8caa260a420a73042e35521de4b5c8baf6446cc/skills/vercel-optimize/scripts/collect-signals.mjs#L54-L90","documentation":"Thrown by main() in collect-signals.mjs when resolveProjectId(explicit) returns null — meaning no positional projectId was given, VERCEL_PROJECT_ID env is unset, and neither `.vercel/repo.json` nor `.vercel/project.json` yielded a projectId. The skill intentionally does not auto-run `vercel link` (the code comment says interactive surprises are bad), so it surfaces this error and asks the user to link explicitly.","triggerScenarios":"Running collect-signals in a directory that was never `vercel link`ed, with no projectId arg and no VERCEL_PROJECT_ID env; the `.vercel` directory is gitignored/absent in CI; project.json/repo.json present but missing the id/projectId fields.","commonSituations":"Fresh clone in CI without linking step; running from the wrong directory; `.vercel` stripped from the artifact; a detached working copy.","solutions":["Run `vercel link` in the project directory to create `.vercel/repo.json` (or `.vercel/project.json`).","Pass the projectId as the first positional: `node scripts/collect-signals.mjs prj_xxx`.","Set VERCEL_PROJECT_ID (and VERCEL_ORG_ID for scope) in the environment."],"exampleFix":"# before\n$ node scripts/collect-signals.mjs\n-> NO_PROJECT_ID: pass one as argv, set VERCEL_PROJECT_ID, or run `vercel link`.\n\n# after\n$ vercel link\n# or\n$ VERCEL_PROJECT_ID=prj_xxx VERCEL_ORG_ID=team_yyy node scripts/collect-signals.mjs","handlingStrategy":"validation","validationCode":"import { readFile } from 'node:fs/promises';\nimport { exists } from 'node:fs/promises';\nasync function assertProjectResolvable(cwd = process.cwd()) {\n  if (process.env.VERCEL_PROJECT_ID) return;\n  if (await exists(`${cwd}/.vercel/repo.json`) || await exists(`${cwd}/.vercel/project.json`)) return;\n  throw new Error('No projectId: run `vercel link`, pass projectId, or set VERCEL_PROJECT_ID');\n}\nawait assertProjectResolvable();","typeGuard":null,"tryCatchPattern":"let project;\ntry {\n  project = await resolveProjectId(explicit);\n} catch (e) { throw e; }\nif (!project) {\n  // prompt user to link, then rerun\n  throw new Error('Link the project first: vercel link');\n}","preventionTips":["Run `vercel link` once per project directory as part of setup.","In CI, set VERCEL_PROJECT_ID (+ VERCEL_ORG_ID) instead of relying on link files.","Commit or persist `.vercel` link files in CI artifacts when reusing workspaces."],"tags":["project-link","config","environment","vercel"],"backgroundTag":null,"analyzedSha":"b8caa260a420a73042e35521de4b5c8baf6446cc","analyzedAt":"2026-08-13T06:03:29.508Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}