Stirling-Tools/Stirling-PDF · error · Error

Missing file entry ${entry.filePath}

Error message

Missing file entry ${entry.filePath}

What it means

Thrown by loadShareBundleEntries while unpacking a share bundle zip: the manifest (stirling-share.json) references entry.filePath, but no entry at that path exists in the zip.

Source

Thrown at frontend/editor/src/core/services/shareBundleUtils.ts:117

  rootOrder: string[];
  sortedEntries: ShareBundleManifest["entries"];
  files: File[];
} | null> {
  const zip = await JSZip.loadAsync(blob);
  const manifestEntry = zip.file(MANIFEST_FILENAME);
  if (!manifestEntry) {
    return null;
  }

  const manifestText = await manifestEntry.async("text");
  const manifest = JSON.parse(manifestText) as ShareBundleManifest;
  const { rootOrder, sortedEntries } = resolveShareBundleOrder(manifest);

  const files: File[] = [];
  for (const entry of sortedEntries) {
    const zipEntry = zip.file(entry.filePath);
    if (!zipEntry) {
      throw new Error(`Missing file entry ${entry.filePath}`);
    }
    const fileBlob = await zipEntry.async("blob");
    files.push(
      new File([fileBlob], entry.name, {
        type: entry.type,
        lastModified: entry.lastModified,
      }),
    );
  }

  return { manifest, rootOrder, sortedEntries, files };
}

export async function extractLatestFilesFromBundle(
  blob: Blob,
  filename: string,
  contentType: string,
): Promise<File[]> {

View on GitHub (pinned to 9ef20dcab8)

Solutions

  1. Re-download or re-share the bundle to rule out truncation.
  2. Open the zip and confirm the listed filePaths actually exist.
  3. Ensure producer and consumer share the same manifest.schemaVersion.
  4. Handle the missing entry gracefully (skip it) instead of aborting the whole load.

Example fix

// before
const zipEntry = zip.file(entry.filePath);
if (!zipEntry) throw new Error(`Missing file entry ${entry.filePath}`);

// after
const zipEntry = zip.file(entry.filePath) ?? zip.file(entry.filePath.replace(/\\\//g, '/'));
if (!zipEntry) {
  console.warn(`Missing file entry ${entry.filePath}; skipping.`);
  continue;
}
Defensive patterns

Strategy: validation

Validate before calling

const manifestPaths = new Set(sortedEntries.map((e) => e.filePath));
const present = new Set(Object.keys(zip.files));
const missing = [...manifestPaths].filter((p) => !present.has(p));
if (missing.length) {
  throw new Error(`Bundle missing entries: ${missing.join(', ')}`);
}

Type guard

function bundleIsComplete(zip: JSZip, entries: ShareBundleManifest['entries']): boolean {
  return entries.every((e) => zip.file(e.filePath) != null);
}

Prevention

When it happens

Trigger: The bundle is truncated/corrupt; the manifest references a path that was never written; path case or separator mismatch; or producer/consumer schema versions differ.

Common situations: Incomplete download of the bundle; a ZIP tool that rewrote entry names (absolute paths, backslashes); manual edits to the bundle; version skew between the exporting and importing Stirling build.

Related errors


AI-assisted analysis of Stirling-Tools/Stirling-PDF@9ef20dcab8 (2026-08-13). Data as JSON: /api/errors/59bf667c53f316d2. Report an issue: GitHub.