jackwener/OpenCLI · warning · EmptyResultError

proxy.golang.org returned no published versions for "${modul

Error message

proxy.golang.org returned no published versions for "${modulePath}".

What it means

Thrown by the `goproxy versions` command when the @v/list endpoint responds successfully but returns an empty list, meaning proxy.golang.org knows the module but has no published versions indexed for it. The library converts this legitimate empty state into an EmptyResultError so callers can distinguish 'no data' from a hard failure.

Source

Thrown at clis/goproxy/versions.js:37

    strategy: Strategy.PUBLIC,
    browser: false,
    args: [
        { name: 'module', positional: true, type: 'string', required: true, help: 'Go module path (e.g. "github.com/gin-gonic/gin")' },
        { name: 'limit', type: 'int', default: 30, help: 'Max rows to return (1-200)' },
        { name: 'with-time', type: 'boolean', default: false, help: 'Fetch each version\'s publish time (one extra request per row)' },
    ],
    columns: [
        'rank', 'module', 'version', 'publishedAt', 'url',
    ],
    func: async (args) => {
        const modulePath = requireModulePath(args.module);
        const limit = requireBoundedInt(args.limit, 30, 200, 'limit');
        const withTime = args['with-time'] === true;
        const encoded = modulePath.split('/').map(encodeURIComponent).join('/');
        const text = await goproxyText(`${GOPROXY_BASE}/${encoded}/@v/list`, `goproxy versions ${modulePath}`);
        const raw = text.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
        if (raw.length === 0) {
            throw new EmptyResultError('goproxy versions', `proxy.golang.org returned no published versions for "${modulePath}".`);
        }
        const sorted = sortVersionsDescending(raw).slice(0, limit);
        if (sorted.length === 0) {
            throw new EmptyResultError('goproxy versions', `"${modulePath}" has no semver-shaped tags on proxy.golang.org.`);
        }
        const rows = sorted.map((v, i) => ({
            rank: i + 1,
            module: modulePath,
            version: v,
            publishedAt: null,
            url: `${GOPROXY_BASE}/${encoded}/@v/${encodeURIComponent(v)}.info`,
        }));
        if (withTime) {
            // Sequential to keep the proxy happy; cap at limit which is already <=200.
            for (const row of rows) {
                const info = await goproxyJson(`${GOPROXY_BASE}/${encoded}/@v/${encodeURIComponent(row.version)}.info`, `goproxy versions ${modulePath} ${row.version}`);
                row.publishedAt = trimDate(info?.Time);
            }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the module path against its go.mod / canonical import path
  2. Check the repository for existing git tags (git tag --list); if none, tag and push a semver tag
  3. Try `go list -m -versions <module>` to cross-check what the ecosystem sees
  4. Retry later if the module was published very recently (proxy caching lag)

Example fix

// before
await goproxyVersions({ module: 'example.com/foo/bar' });
// after
if (!repoHasSemverTags('example.com/foo/bar')) throw new Error('tag a v1.x.x release first');
await goproxyVersions({ module: 'example.com/foo/bar' });
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the module is reachable and tagged before calling
const res = await fetch('https://proxy.golang.org/' + encodePath(modulePath) + '/@v/list');
const list = (await res.text()).trim();
if (!list) console.warn(modulePath + ' has no published versions');

Type guard

function hasVersions(text) { return typeof text === 'string' && text.split(/\r?\n/).map(s => s.trim()).filter(Boolean).length > 0; }

Try / catch

try {
  const versions = await goproxyVersions({ module });
} catch (err) {
  if (/no published versions/i.test(err.message)) {
    console.warn(`Module ${module} has no tagged releases yet.`);
  } else throw err;
}

Prevention

When it happens

Trigger: Running `goproxy versions <modulePath>` where GET https://proxy.golang.org/<module>/@v/list returns 200 with a blank body: module reserved/published without tagged versions, or proxy cache has no version listing yet.

Common situations: Typos creating a plausible-but-wrong module path, a repo that has only a default branch with no git tags, a module just published whose listing hasn't propagated, or querying modules that only exist via pseudo-versions elsewhere.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/85a7c7a6acb7fae2. Report an issue: GitHub.