Skip to content
Latchkey

Pact consumerVersionSelectors returns no pacts in CI

consumerVersionSelectors tell the provider which consumer pact versions to verify. If the selectors reference a branch, tag, or environment that has no matching published pacts, the verifier fetches an empty set and verifies nothing.

What this error means

Provider verification reports zero interactions and the log shows the configured selectors returned no pacts, often after switching from tags to branches.

Pact
INFO: Selecting pacts using consumerVersionSelectors:
  [{"tag":"prod"}]
WARN: No pacts found matching selectors. Did you mean mainBranch or deployedOrReleased?

Common causes

Selectors use a tag or branch with no pacts

The selector targets a tag or branch that no consumer has published against, so nothing matches.

Deprecated tag selectors after moving to branches

The project migrated consumers to branch-based publishing but the selectors still filter by an old tag.

How to fix it

Use branch and deployed selectors

  1. Replace stale tag selectors with mainBranch and deployedOrReleased.
  2. Confirm consumers publish with a matching branch.
  3. Re-run and verify pacts are now selected.
provider.verify.js
consumerVersionSelectors: [
  { mainBranch: true },
  { deployedOrReleased: true },
  { matchingBranch: true },
]

Confirm what is published for the consumer

List the consumer versions and their branches in the broker to pick selectors that actually match.

Terminal
pact-broker describe-version \
  --pacticipant web-consumer --latest \
  --broker-base-url "$PACT_BROKER_BASE_URL"

How to prevent it

  • Prefer mainBranch/deployedOrReleased selectors over hardcoded tags.
  • Keep consumer publish branches aligned with provider selectors.
  • Fail the build when selectors return zero pacts.

Frequently asked questions

What causes "consumerVersionSelectors empty"?
The selector targets a tag or branch that no consumer has published against, so nothing matches.
How do I fix consumerVersionSelectors empty?
Use branch and deployed selectors

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card