paperclipai/paperclip · error · Error

Packed tarball was not created at ${tarballPath}

Error message

Packed tarball was not created at ${tarballPath}

What it means

After packLocalPackage runs pnpm build and pnpm pack --pack-destination <dir>, it constructs the expected tarball filename from package.json name/version and checks existence. If the file is not there, the pack step produced a different filename than expected — almost always a name/version mismatch between what was read and what pnpm pack emitted.

Source

Thrown at packages/plugins/create-paperclip-plugin/src/index.ts:111

    throw new Error(`Package package.json not found at ${packageJsonPath}`);
  }

  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8")) as {
    name?: string;
    version?: string;
  };
  const packageName = packageJson.name ?? path.basename(packagePath);
  const packageVersion = packageJson.version ?? "0.0.0";
  const tarballFileName = `${packageName.replace(/^@/, "").replace("/", "-")}-${packageVersion}.tgz`;
  const sdkBundleDir = path.join(outputDir, ".paperclip-sdk");

  fs.mkdirSync(sdkBundleDir, { recursive: true });
  execFileSync("pnpm", ["build"], { cwd: packagePath, stdio: "pipe" });
  execFileSync("pnpm", ["pack", "--pack-destination", sdkBundleDir], { cwd: packagePath, stdio: "pipe" });

  const tarballPath = path.join(sdkBundleDir, tarballFileName);
  if (!fs.existsSync(tarballPath)) {
    throw new Error(`Packed tarball was not created at ${tarballPath}`);
  }

  return tarballPath;
}

/**
 * Generate a complete Paperclip plugin starter project.
 *
 * Output includes manifest/worker/UI entries, SDK harness tests, bundler presets,
 * and a local dev server script for hot-reload workflow.
 */
export function scaffoldPluginProject(options: ScaffoldPluginOptions): string {
  const template = options.template ?? "default";
  if (!VALID_TEMPLATES.includes(template)) {
    throw new Error(`Invalid template '${template}'. Expected one of: ${VALID_TEMPLATES.join(", ")}`);
  }

  if (!isValidPluginName(options.pluginName)) {

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Run 'pnpm pack --pack-destination /tmp' in the package dir and compare the emitted filename to tarballFileName.
  2. Check for prepack/prepare scripts that change name or version, and account for them.
  3. If using pnpm workspace catalog versioning, ensure package.json 'version' is a concrete semver, not a workspace reference.

Example fix

# diagnose
$ cd packages/shared && pnpm pack --pack-destination /tmp
# observe actual tarball name vs expected, fix version/source of mismatch
Defensive patterns

Strategy: validation

Validate before calling

import { execFileSync } from 'node:child_process';
function expectedTarballName(pkgDir: string): string {
  const pj = JSON.parse(fs.readFileSync(path.join(pkgDir,'package.json'),'utf8'));
  const name = (pj.name ?? path.basename(pkgDir)).replace(/^@/, '').replace('/', '-');
  const version = pj.version ?? '0.0.0';
  return `${name}-${version}.tgz`;
}

Prevention

When it happens

Trigger: package.json name/version read by the scaffolder does not match what pnpm pack actually wrote — e.g. a 'prepare'/'prepack' script mutated the package, a pnpm workspace version pinning overrode the version, or name scoping differs (the .replace calls assume @scope/name -> scope-name format).

Common situations: packages/shared has a prepack script; pnpm workspace 'catalog:' or 'workspace:' protocol rewrote the version at pack time; the package uses a name format the replace regex doesn't normalize the same way pnpm does.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/e2a639075342ff4c. Report an issue: GitHub.