go
build_error
ai_generated
true
go: inconsistent vendoring in /path/to/project: go.mod requires github.com/foo/bar v1.4.0 but vendor/modules.txt has v1.2.0
ID: go/module-graph-version-conflict
80%Fix Rate
85%Confidence
0Evidence
2024-03-15First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.14 | active | — | — | — |
| 1.21 | active | — | — | — |
| 1.24 | active | — | — | — |
Root Cause
Vendor directory is out of sync with go.mod after updating a dependency version but not re-running 'go mod vendor'.
generic中文
更新依赖版本后未重新运行 'go mod vendor',导致 vendor 目录与 go.mod 不同步。
Workarounds
-
95% success
go mod vendor
-
90% success
go mod tidy && go mod vendor
Dead Ends
Common approaches that don't work:
-
95% fail
Vendor directory contains actual source code and checksums; manual edits cause more inconsistencies and build failures.
-
80% fail
If the project is configured for vendoring (with -mod=vendor), removing it causes 'cannot find module' errors unless you switch to network mode.