{"record":{"id":"4b0d8f7d9a1dcd2f","repo":"nodejs/node","slug":"found-multiple-children-with-path-child-path","errorCode":null,"errorMessage":"Found multiple children with path ${child_path}","messagePattern":"Found multiple children with path (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"tools/gyp/pylib/gyp/xcodeproj_file.py","lineNumber":1208,"sourceCode":"        # children.\n        for child in self._properties.get(\"children\", []):\n            child_name = child.Name()\n            if child_name is not None:\n                hashables.append(child_name)\n\n        return hashables\n\n    def HashablesForChild(self):\n        # To avoid a circular reference the hashables used to compute a child id do\n        # not include the child names.\n        return XCHierarchicalElement.Hashables(self)\n\n    def _AddChildToDicts(self, child):\n        # Sets up this PBXGroup object's dicts to reference the child properly.\n        child_path = child.PathFromSourceTreeAndPath()\n        if child_path:\n            if child_path in self._children_by_path:\n                raise ValueError(\"Found multiple children with path \" + child_path)\n            self._children_by_path[child_path] = child\n\n        if isinstance(child, PBXVariantGroup):\n            child_name = child._properties.get(\"name\", None)\n            key = (child_name, child_path)\n            if key in self._variant_children_by_name_and_path:\n                raise ValueError(\n                    \"Found multiple PBXVariantGroup children with \"\n                    + \"name \"\n                    + str(child_name)\n                    + \" and path \"\n                    + str(child_path)\n                )\n            self._variant_children_by_name_and_path[key] = child\n\n    def AppendChild(self, child):\n        # Callers should use this instead of calling\n        # AppendProperty('children', child) directly because this function","sourceCodeStart":1190,"sourceCodeEnd":1226,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/gyp/pylib/gyp/xcodeproj_file.py#L1190-L1226","documentation":"Raised by PBXGroup._AddChildToDicts when a child element (a file, group, or reference) being added to an Xcode group has the same source-tree-relative path as an existing child in that group. Xcode groups enforce path uniqueness among direct children; duplicates would corrupt the generated .pbxproj. This is a structural integrity check during .xcodeproj generation from gyp.","triggerScenarios":"AppendChild(child) is called on a PBXGroup that already contains an entry with the same PathFromSourceTreeAndPath() value. Typically two source files or sub-groups with identical paths are added to the same group in the gyp target definition.","commonSituations":"A gyp target lists the same source file twice under 'sources'. Two groups or file references resolve to the same path. A glob pattern in sources matching overlapping files. Duplicated entries in a resources or frameworks list.","solutions":["Search the target's 'sources' (and other file lists) for duplicate paths and remove the duplicates.","Check that glob patterns in sources do not overlap, producing the same file from multiple patterns.","Verify that source-tree-relative paths are unique within each Xcode group in the .gyp file.","If the same file must be referenced in multiple targets, ensure each is a separate group/target, not the same group."],"exampleFix":"# before\n'sources': ['src/foo.c', 'src/foo.c']\n# after\n'sources': ['src/foo.c']","handlingStrategy":"validation","validationCode":"# Deduplicate source paths before generation\nsources = list(dict.fromkeys(target.get('sources', [])))  # preserve order, drop dups\nif len(sources) != len(target.get('sources', [])):\n    print('warning: duplicate sources removed')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Deduplicate 'sources', 'mac_bundle_resources', and file lists in .gyp files.","Review glob patterns for overlap before adding them to sources."],"tags":["xcode","gyp","xcodeproj","configuration","duplicate"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}