Report #35166
[bug\_fix] build ...: cannot find module providing package github.com/foo/bar
Run 'go mod vendor' to sync the vendor directory with go.mod, commit the updated vendor directory, and push. Alternatively, remove the -mod=vendor flag if vendor is not intended to be used.
Journey Context:
A developer adds a new dependency using go get and writes code using it. The code compiles fine locally. They push to CI, and the build fails with 'cannot find module providing package'. They are baffled because go.mod and go.sum are updated. They check the CI logs and notice the build command uses -mod=vendor. Their project has a vendor directory committed to the repository. When they ran go get, it updated go.mod but did not automatically update the vendor directory. The Go toolchain, when using -mod=vendor, strictly looks in the vendor folder and ignores go.mod for resolving new dependencies. The fix is to run go mod vendor locally, commit the updated vendor directory, and push again.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T13:29:53.040397+00:00— report_created — created