{"record":{"id":"08528c199dbc6010","repo":"musistudio/claude-code-router","slug":"projectid-is-required","errorCode":null,"errorMessage":"projectId is required.","messagePattern":"projectId is required\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/electron/bundled-plugins/claude-design/index.cjs","lineNumber":1156,"sourceCode":"    introText: stringValue(body?.introText) || stringValue(body?.intro_text),\n    name: stringValue(body?.name) || \"Untitled design system\",\n    templateId: stringValue(body?.templateId) || stringValue(body?.template_id),\n    templateTitle: stringValue(body?.templateTitle) || stringValue(body?.template_title),\n    type: normalizeDesignSyncProjectTypeFilter(body?.type ?? body?.projectType ?? body?.project_type)\n  });\n  const projectId = project.projectId || project.uuid;\n  return {\n    name: project.name,\n    project: designSyncJsonProjectPayload(runtime, getOmeletteProject(runtime, projectId)),\n    projectId,\n    project_id: projectId\n  };\n}\n\nfunction getDesignSyncJsonProject(runtime, body) {\n  const projectId = stringValue(body?.projectId) || stringValue(body?.project_id);\n  if (!projectId) {\n    throw new Error(\"projectId is required.\");\n  }\n  const project = designSyncJsonProjectPayload(runtime, getOmeletteProject(runtime, projectId));\n  return {\n    project,\n    ...project\n  };\n}\n\nfunction listDesignSyncJsonFiles(runtime, body) {\n  const projectId = designSyncJsonProjectId(body);\n  const directory = sanitizeProjectFilePath(body?.path || \"\");\n  const depth = numberValue(body?.depth) ?? 1;\n  const offset = Math.max(0, numberValue(body?.offset) ?? 0);\n  const filter = stringValue(body?.filter);\n  const allEntries = listProjectDirectoryEntries(runtime, projectId, directory, depth, filter);\n  const limit = 200;\n  const entries = allEntries.slice(offset, offset + limit);\n  return {","sourceCodeStart":1138,"sourceCodeEnd":1174,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/electron/bundled-plugins/claude-design/index.cjs#L1138-L1174","documentation":"Thrown by getDesignSyncJsonProject in the claude-design bundled plugin when neither `projectId` nor `project_id` is present (or both are empty strings) in the request body. The design-sync JSON handler needs a project identifier to look up the Omelette project.","triggerScenarios":"POSTing to the design sync JSON endpoint with a body that omits projectId/project_id, passes an empty string, or uses a different key name (e.g. `id`).","commonSituations":"Client built the request from a partial config where the project was never created; key-name mismatch between snake_case and camelCase clients; project deleted and the caller lost track of its id.","solutions":["Include projectId (or project_id) as a non-empty string in the request body","Fetch the project list first to obtain a valid id if unknown","Check for typos in the key name (projectId vs project_id vs id)"],"exampleFix":"// before\nbody = { name: \"My Project\" }\n\n// after\nbody = { projectId: \"proj_123\", name: \"My Project\" }","handlingStrategy":"validation","validationCode":"const projectId = body?.projectId || body?.project_id;\nif (!projectId) throw new ValidationError(\"projectId\", \"required before calling design sync\");","typeGuard":"function hasProjectId(body: unknown): body is { projectId: string } {\n  const b = body as Record<string, unknown>;\n  return typeof (b?.projectId ?? b?.project_id) === \"string\" && (b.projectId ?? b.project_id) !== \"\";\n}","tryCatchPattern":"try { getDesignSyncJsonProject(runtime, body); } catch (e) { if (e instanceof Error && e.message === \"projectId is required.\") return respond(400, { error: e.message }); throw e; }","preventionTips":["Set projectId in one shared request-builder","Reject requests early in middleware when projectId is missing","Accept both projectId and project_id in custom clients"],"tags":["validation","missing-parameter","design-sync","plugin"],"backgroundTag":"missing-required-parameter","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}