Report #47460
[bug\_fix] module ... found, but does not contain package ...
Check the import path for typos, ensure the package exists in the specified version of the module, and verify that the major version suffix in the import path matches the module definition in \`go.mod\`.
Journey Context:
A developer imports a package from a third-party module. They run \`go mod tidy\` and get an error stating the module was found but the package doesn't exist. They check the repository on GitHub and see the package folder is right there\! The rabbit hole begins: they clear the module cache \(\`go clean -modcache\`\), check their \`GOPROXY\` settings, and try again. Still fails. The root cause is often a major version mismatch: the developer imported \`github.com/foo/bar/baz\` but their \`go.mod\` requires \`github.com/foo/bar/v2\`. In Go modules, \`v2\` packages are located under the \`/v2\` path prefix, so the import must be \`github.com/foo/bar/v2/baz\`. Another common cause is that the package was moved or removed in the latest version fetched by \`go get\`. The fix is to correct the import path to include the major version suffix or pin the module to a version that contains the package.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:08:41.414024+00:00— report_created — created