question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sfdx force:source:push doesn't seem to be calculating dependency order properly

See original GitHub issue

Summary

I have an sfdx project with two packages: Package A with some common lib code and Package B with my core application. Both packages are listed in sfdx-project.json with Package B listed second in the order and specifying Package A as a dependency.

When I sfdx force:source:push, Package B seems to be installed first which sets off a cascading series of errors because references to elements in Package A don’t exist.

I could be missing something obvious, but I think this is what’s happening because if I push Package A explicitly (by itself) first, THEN push Package B, everything compiles.

Thanks

Steps To Reproduce:

  1. Create a project with two packages, one relying on the other
  2. sfdx force:source:push

Expected result

Package A is installed first, followed by Package B

Actual result

Package B seems to be installed first.

Additional information

This seems to be an intermittent issue: I was able to build my project against a different fresh scratch org yesterday, today it isn’t working.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version): sfdx-cli/7.13.0-27dbcb37d3 darwin-x64 node-v10.15.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core):

@oclif/plugin-commands 1.2.2 (core)
@oclif/plugin-help 2.2.0 (core)
@oclif/plugin-not-found 1.2.2 (core)
@oclif/plugin-plugins 1.7.8 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.5 (core)
analytics 1.1.2 (core)
generator 1.1.0 (core)
salesforcedx 46.3.0 (core)
├─ force-language-services 46.8.0 (core)
└─ salesforce-alm 46.7.0 (core)

OS and version: macOS 10.14.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
clairebianchicommented, Apr 20, 2020

@azlamsalam we are actively working on this and plan to have an announcement in Github this Thursday with details on how to test out our changes.

0reactions
mshanemccommented, Jul 9, 2021

Closing. Packages go in the order listed in the file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SFDX not pushing - Salesforce Stack Exchange
If I run sfdx force:source:status, I get "No Results found". I double checked the scratch org -- the class isn't there, but sfdx...
Read more >
sfdx push results in huge list of errors - Salesforce Developers
I tried to use the --forceoverwrite parameter on sfdx push, ... I receive errors when executing the push command "sfdx force:source:push ...
Read more >
Metadata API Developer Guide
Metadata is data that describes other data. To understand how Salesforce defines metadata, contrast business data with Salesforce metadata.
Read more >
History - CumulusCI 3.71.0 documentation
CumulusCI now supports deploying unmanaged dependencies in SFDX source format. ... using the Metadata API rather than the sfdx force:source:push command.
Read more >
Error when trying to get the next package version - sfdx - GitLab
I removed the --released flag from the sfdx force:package:version:list command and it fixed the issue for me.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found