{"record":{"id":"23fab78430ac623b","repo":"jackwener/OpenCLI","slug":"nuget-package","errorCode":"nuget package","errorMessage":"No published versions found for NuGet package \"${id}\".","messagePattern":"No published versions found for NuGet package \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/nuget/package.js","lineNumber":71,"sourceCode":"                const leaf = await nugetFetch(pageUrl, 'nuget package page');\n                if (!Array.isArray(leaf?.items)) {\n                    throw new CommandExecutionError(\n                        `nuget package registration leaf ${pageUrl} did not include an items array`,\n                    );\n                }\n                pageItems = leaf.items;\n            }\n            for (const it of pageItems) {\n                if (!it || typeof it !== 'object' || !it.catalogEntry || typeof it.catalogEntry !== 'object') {\n                    throw new CommandExecutionError(\n                        `nuget package registration page ${pageIndex + 1} contains a malformed version entry`,\n                    );\n                }\n                allEntries.push(it);\n            }\n        }\n        if (!allEntries.length) {\n            throw new EmptyResultError('nuget package', `No published versions found for NuGet package \"${id}\".`);\n        }\n        // Sort by published desc; ties broken by version string descending.\n        const sorted = [...allEntries].sort((a, b) => {\n            const ap = a?.catalogEntry?.published ?? '';\n            const bp = b?.catalogEntry?.published ?? '';\n            if (ap !== bp) return bp.localeCompare(ap);\n            const av = a?.catalogEntry?.version ?? '';\n            const bv = b?.catalogEntry?.version ?? '';\n            return bv.localeCompare(av);\n        });\n        return sorted.map((entry, i) => {\n            const cat = entry?.catalogEntry ?? {};\n            return {\n                rank: i + 1,\n                id: typeof cat?.id === 'string' ? cat.id : id,\n                version: typeof cat?.version === 'string' ? cat.version : null,\n                title: typeof cat?.title === 'string' ? cat.title : null,\n                authors: joinAuthors(cat?.authors),","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/nuget/package.js#L53-L89","documentation":"An EmptyResultError thrown after successfully fetching and parsing the registration pages but finding zero version entries. It means the package id resolved to a registration document with no published versions, so there is nothing to sort or return.","triggerScenarios":"Running the nuget package command with an id that is unlisted-with-no-versions, deleted from the feed, exists only as a placeholder, or whose registration index contains pages but no items after validation; also any typo'd id that still returns an empty registration index.","commonSituations":"Typos in the package id or wrong casing assumptions on a custom feed; package was delisted/removed from nuget.org; querying a brand-new or internal package not yet published; pointing the CLI at a private feed where the package does not exist.","solutions":["Double-check the package id spelling with `nuget search <term>` or on nuget.org.","Run `nuget search` first to confirm the package exists and is published.","If it is a private package, verify you are querying the correct feed/source and have access.","If the package was recently published, wait for CDN propagation and retry.","If the package was deleted/unlisted, choose an alternative package."],"exampleFix":"// before\ntry {\n  const pkg = await nugetPackage('Newtonsoft.Jsonn'); // typo'd id\n} catch (e) { /* EmptyResultError */ }\n// after\nconst results = await nugetSearch('Newtonsoft.Json');\nconst id = results[0].id; // use the exact id from search\nconst pkg = await nugetPackage(id);","handlingStrategy":"try-catch","validationCode":"const res = await fetch(`https://api.nuget.org/v3/registration5-gz-semver2/${id.toLowerCase()}/index.json`);\nif (!res.ok) throw new Error(`Package ${id} not found (HTTP ${res.status})`);","typeGuard":"null","tryCatchPattern":"try {\n  const pkg = await nugetPackage(id);\n} catch (err) {\n  if (err.name === 'EmptyResultError') {\n    console.warn(`Package \"${id}\" has no published versions; check spelling or feed`);\n  } else throw err;\n}","preventionTips":["Run nuget search first to confirm the exact id exists.","Check the package page on nuget.org before programmatic queries.","For private packages, ensure the correct feed/source is configured.","Allow for CDN propagation delay after first publish."],"tags":["nuget","empty-result","package-not-found"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}