Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Error: CustomField Not in package.xml when defining custom field in child managed 2gp from a custom object created in parent managed2gp under the same namespace

Open
#3,227 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
node.js
Domain
cli, devtools

Research direction

Reproduce the installation using the parent and child managed 2gp packages described in the steps, including the force-app/main/default/nmsp__O/F__c.xml metadata path. Inspect how the CLI builds or validates package.xml for the child package, then verify that installing the package in an empty scratch org no longer reports O__c.F__c as missing.

Written by the indexing model from the issue text.

Description

area:packaging
Summary

I am not able to install a child managed 2gp version that has a custom field in a custom object from its parent managed 2gp (in the same namespace). Getting Error: CustomField Not in package.xml for that custom field when trying to install the package. Creation of the package (even with validations) does not fail

Steps To Reproduce

IMPORTANT
1-Create a parent 2gp managed package A under namespace nmsp, and create a custom object O. Create a new beta version for this package
2-Create a child 2gp managed package B. Create dependency between package A and B (we are using cumulusCI), and create in custom object O a field F. The field F will be stored in force-app/main/default/nmsp__O/F__c.xml-meta....
4-Create new package version for package B with NO validation skip. Package can be created successfully
5-Install package version in new scratch org empty. CumulusCI is successfully installing all dependencies, but when trying to install metadata, getting the following errors:
Error: CustomField Not in package.xml, Details: O__c.F__c: Not in package.xml

Expected result

I should be able to successsuly install package

Actual result

Cannot install package (error)

Additional information
System Information
@salesforce/cli/2.78.3 darwin-arm64 node-v20.17.0
Dominant language
No language data
Stars
571
Forks
80
Avg merge
2d 21h
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from forcedotcom/cli

All issues in forcedotcom/cli

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.