{"record":{"id":"01b42b2a5befaafe","repo":"facebook/docusaurus","slug":"missing-project-name-did-you-forget-to-define-pr","errorCode":null,"errorMessage":"Missing project name. Did you forget to define \"projectName\" in ${siteConfigPath}? You may also export it via the PROJECT_NAME environment variable.","messagePattern":"Missing project name\\. Did you forget to define \"projectName\" in (.+?)\\? You may also export it via the PROJECT_NAME environment variable\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/docusaurus/src/commands/deploy.ts","lineNumber":150,"sourceCode":"  }\n\n  const organizationName =\n    process.env.ORGANIZATION_NAME ??\n    process.env.CIRCLE_PROJECT_USERNAME ??\n    siteConfig.organizationName;\n  if (!organizationName) {\n    throw new Error(\n      `Missing project organization name. Did you forget to define \"organizationName\" in ${siteConfigPath}? You may also export it via the ORGANIZATION_NAME environment variable.`,\n    );\n  }\n  logger.info`organizationName: name=${organizationName}`;\n\n  const projectName =\n    process.env.PROJECT_NAME ??\n    process.env.CIRCLE_PROJECT_REPONAME ??\n    siteConfig.projectName;\n  if (!projectName) {\n    throw new Error(\n      `Missing project name. Did you forget to define \"projectName\" in ${siteConfigPath}? You may also export it via the PROJECT_NAME environment variable.`,\n    );\n  }\n  logger.info`projectName: name=${projectName}`;\n\n  // We never deploy on pull request.\n  const isPullRequest =\n    process.env.CI_PULL_REQUEST ?? process.env.CIRCLE_PULL_REQUEST;\n  if (isPullRequest) {\n    exec('echo \"Skipping deploy on a pull request.\"', {\n      log: false,\n      failfast: true,\n    });\n    process.exit(0);\n  }\n\n  // github.io indicates organization repos that deploy via default branch. All\n  // others use gh-pages (either case can be configured actually, but we can","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus/src/commands/deploy.ts#L132-L168","documentation":"Thrown by `docusaurus deploy` when the target GitHub repository name cannot be resolved. The deploy command resolves projectName from `process.env.PROJECT_NAME`, then CircleCI's `CIRCLE_PROJECT_REPONAME`, then `siteConfig.projectName`. Without it, the deployment git remote and the published site URL cannot be constructed.","triggerScenarios":"Running `docusaurus deploy` with `projectName` absent from `docusaurus.config.js`, no `PROJECT_NAME` env var, and not on CircleCI (or `CIRCLE_PROJECT_REPONAME` unavailable).","commonSituations":"Fresh project where `projectName` was never set; renamed GitHub repository without updating config; non-CircleCI CI that does not expose `CIRCLE_PROJECT_REPONAME`; local deploy run without env vars.","solutions":["Add `projectName: 'your-repo-name'` (the GitHub repo name, not URL) to `docusaurus.config.js`/`.ts`.","Export `PROJECT_NAME` in the deploy environment: `export PROJECT_NAME=your-repo-name`.","On CircleCI, confirm the job is a real project build so `CIRCLE_PROJECT_REPONAME` is populated.","Re-check that the config actually loaded is the one you edited (pass `--config` explicitly if needed)."],"exampleFix":"// before\nexport default { url: 'https://example.com', organizationName: 'org' };\n// after\nexport default {\n  url: 'https://org.github.io',\n  organizationName: 'org',\n  projectName: 'my-repo',\n};","handlingStrategy":"validation","validationCode":"const project = process.env.PROJECT_NAME\n  ?? process.env.CIRCLE_PROJECT_REPONAME\n  ?? siteConfig.projectName;\nif (!project) throw new Error('projectName required for deploy');","typeGuard":"function hasProjectName(cfg: any): cfg is { projectName: string } {\n  return typeof cfg?.projectName === 'string' && cfg.projectName.length > 0;\n}","tryCatchPattern":"try { await deploy(siteDir, cliOptions); }\ncatch (e) {\n  if (/Missing project name/.test(e.message)) {\n    console.error('Set projectName in config or PROJECT_NAME env'); process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Treat `organizationName` and `projectName` as required deploy inputs in CI templates.","Add a pre-deploy config sanity check script.","Pin the deploy job to fail fast on missing metadata rather than mid-push."],"tags":["deploy","github-pages","config","env"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}