Ocassionally due to release windows or on packages that have excessive dependencies, the build time will for an unlocked package will be excessive, this section deals on the possible solutions available
Wait for Salesforce Updates: The issue should improve once the system is updated to next release for your DevHub
Utilize Scratch Org Snapshots: This is particularly useful for packages with many managed dependencies. However, it's worth noting that there are still some bugs affecting package creation in the Closed Beta of this feature.
Switch to Source Packages Temporarily: This can be done by renaming the package aliases in sfdx-project.json
. However, dependencies to other source packages need to be removed for each source package, as source packages cannot be listed as dependencies for other source packages.