{"record":{"id":"97fb540aa347969c","repo":"angular/angular-cli","slug":"skipping-invalid-project-value-expected-an-object","errorCode":null,"errorMessage":"Skipping invalid project value; expected an object.","messagePattern":"Skipping invalid project value; expected an object\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular_devkit/core/src/workspace/json/reader.ts","lineNumber":160,"sourceCode":"      createVirtualAstObject(workspaceNodeValue, {\n        exclude: ['$schema', 'version', 'projects'],\n        listener(path, value) {\n          jsonMetadata.addChange(path, value);\n        },\n      }),\n  } as WorkspaceDefinition;\n}\n\nfunction parseProjectsObject(\n  projectsNode: Node,\n  context: ParserContext,\n): Record<string, ProjectDefinition> {\n  const projects: Record<string, ProjectDefinition> = Object.create(null);\n\n  for (const [name, value] of Object.entries<JsonValue>(getNodeValue(projectsNode))) {\n    const nodes = findNodeAtLocation(projectsNode, [name]);\n    if (!isJsonObject(value) || !nodes) {\n      context.warn('Skipping invalid project value; expected an object.', value);\n      continue;\n    }\n\n    projects[name] = parseProject(name, nodes, context);\n  }\n\n  return projects;\n}\n\nfunction parseProject(\n  projectName: string,\n  projectNode: Node,\n  context: ParserContext,\n): ProjectDefinition {\n  const jsonMetadata = context.metadata;\n  let targets;\n  let hasTargets = false;\n  let extensions: Record<string, JsonValue> | undefined;","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/core/src/workspace/json/reader.ts#L142-L178","documentation":"While parsing the 'projects' section of angular.json, the reader skips any entry whose value is not a JSON object (or whose AST node is missing) and emits this warning instead of failing the whole workspace load.","triggerScenarios":"parseProjectsObject iterates projects entries and finds a value that is a string, number, array, boolean, or null instead of an object (e.g. \"projects\": { \"my-app\": null }).","commonSituations":"Merge conflicts in angular.json leaving corrupt project entries; scripts regenerating angular.json writing placeholders; accidental deletion of a project's body leaving an empty/null value.","solutions":["Restore the project entry to a full object with at least 'root' and project metadata.","Remove the invalid entry entirely if the project no longer exists.","Re-run `ng generate` / restore angular.json from version control to repair merge-damaged entries."],"exampleFix":"// before (angular.json)\n\"projects\": { \"my-app\": null }\n// after\n\"projects\": { \"my-app\": { \"root\": \"projects/my-app\", \"projectType\": \"application\" } }","handlingStrategy":"type-guard","validationCode":"const json = require('./angular.json');\nfor (const [name, value] of Object.entries(json.projects ?? {})) {\n  if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n    throw new Error(`Project '${name}' in angular.json must be an object, got: ${JSON.stringify(value)}`);\n  }\n}","typeGuard":"function isValidProject(v) {\n  return typeof v === 'object' && v !== null && !Array.isArray(v);\n}","tryCatchPattern":null,"preventionTips":["Resolve angular.json merge conflicts fully, never leave partial entries.","Validate angular.json with a JSON schema in CI (e.g. @schematics/angular schema).","Avoid scripts that rewrite angular.json without full object payloads."],"tags":["angular","workspace-configuration","angular-json","validation"],"backgroundTag":"invalid-project-definition","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}