Loading

Scratch Org Creation Fails (struck in new state), due to Metadata Name Collision Across Independent 2GP Packages in the Same Namespace

Date de publication: Aug 20, 2026
Description

Steps to Reproduce

  1. Create two independent/unrelated 2GP packages under the same namespace.
  2. Ensure both packages contain at least one component with the same name.
  3. Create a new SFDX project.
  4. Add both 2GP packages to the sfdx-project.json file and specify their respective ancestors.
  5. Attempt to create a scratch org.
  6. Scratch org creation fails (struck in new status) due to a metadata name collision.
Résolution

As a workaround, avoid including unrelated 2GP packages in the same SFDX project.

  • Use a separate SFDX project for each independent 2GP package.
  • Include only the package and its relevant ancestor/package dependencies in the corresponding sfdx-project.json.
  • Avoid combining unrelated packages that share the same namespace, particularly when they contain components with identical names.

This modular project structure helps prevent metadata name collisions during scratch org creation.




Numéro d’article de la base de connaissances

005391240

 
Chargement
Salesforce Help | Article