paperclipai/paperclip · error · Error

npm accepted the preview but it is not yet visible

Error message

npm accepted the preview but it is not yet visible: ${[...pending].join(", ")}. Retry reuses published packages.

What it means

The publish-preview script publishes npm packages for a preview SHA and then polls the registry for their visibility. If, after repeated polling (10-second sleeps), some packages still have not become visible on npm, it throws this error. It signals that the publish step succeeded from npm's perspective but the registry has not propagated the packages, so downstream 'result' checks would fail.

Solutions

  1. Wait and re-run the publish/publish-image workflow — the script intentionally makes retries idempotent by reusing already-published packages.
  2. Check npm status (status.npmjs.org) for registry incidents causing propagation lag.
  3. Verify the npm registry configured in .npmrc matches the registry queried by the visibility check; fix mirror/registry mismatch.
  4. Inspect the workflow log for which package names are pending and confirm the publish step actually uploaded all planned packages.

Example fix

// before: failing because registry lags
await publishPreview(sha, requestId);
// after: retry the workflow step with backoff; publish is idempotent
await sleep(60_000);
await publishPreview(sha, requestId); // reuses already published packages
Defensive patterns

Strategy: retry

Validate before calling

for (const name of packages) {
  if (!(await packageExists(name, sha))) console.warn(`${name} not yet visible; publish will retry`);
}

Type guard

null

Try / catch

try {
  await publishPreview(sha, requestId);
} catch (e) {
  if (String(e.message).includes('not yet visible')) {
    await sleep(60_000);
    return publishPreview(sha, requestId); // idempotent retry
  }
  throw e;
}

Prevention

When it happens

Trigger: Running `preview-artifacts.mjs publish` where npm returns success for the publish but a subsequent `packageExists` check keeps failing for one or more packages until the retry loop exhausts; typically caused by registry propagation delay, an npm outage, or publishing to a registry/endpoint where visibility checks hit a different index.

Common situations: GitHub Actions preview workflows during npm CDN lag right after publish; npm incidents degrading search/fetch endpoints; misconfigured npm registry mirrors that accept publishes but delay or never serve the new versions.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18). Data as JSON: /api/errors/19d5bd11d20a40d1. Report an issue: GitHub.

Appendix: source

Thrown at scripts/preview-artifacts.mjs:196

    if (await packageExists(name, sha, fetchImpl)) { console.log(`Reusing ${name}@${versionFor(sha)}`); continue; }
    console.log(`Publishing ${name}@${versionFor(sha)} (${createHash("sha256").update(bytes).digest("hex").slice(0, 12)})`);
    // No package checkout, lifecycle scripts, npmrc, or branch code runs here.
    exec("npm", ["publish", file, "--tag", "preview", "--access", "public", "--ignore-scripts", "--provenance", "--registry", "https://registry.npmjs.org"], { stdio: "inherit" });
    pending.add(name);
  }
  // npm accepts a package without resolving its dependencies. Submit both
  // packages before waiting so their registry propagation can overlap.
  for (let attempt = 0; pending.size && attempt < 60; attempt++) {
    const checks = await Promise.all([...pending].map(async (name) => ({ name, visible: await packageExists(name, sha, fetchImpl) })));
    for (const { name, visible } of checks) {
      if (visible) {
        pending.delete(name);
        console.log(`Visible ${name}@${versionFor(sha)}`);
      }
    }
    if (pending.size) await sleep(10_000);
  }
  if (pending.size) throw new Error(`npm accepted the preview but it is not yet visible: ${[...pending].join(", ")}. Retry reuses published packages.`);
}

if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
  const [command, ...args] = process.argv.slice(2);
  try {
    if (command === "plan" || command === "plan-migrator") {
      const [sha, requestId, migrator] = args;
      validateRequest(sha, requestId);
      if (process.env.GITHUB_REF !== "refs/heads/master") throw new Error("Preview workflow definitions must run from master.");
      const { image, packages } = await planArtifacts(sha, {
        image: command === "plan", migrator: command === "plan-migrator" || migrator === "true",
      });
      appendFileSync(process.env.GITHUB_OUTPUT, `image=${image}\npackages=${packages}\n`);
    } else if (command === "pack") packPreview(...args);
    else if (command === "publish") await publishPreview(...args);
    else if (command === "publish-image") await publishImage(...args);
    else if (command === "result") {
      const [sha, requestId] = args;

View on GitHub (pinned to 3f1d897a7c)