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
- Re-download or re-share the bundle to rule out truncation.
- Open the zip and confirm the listed filePaths actually exist.
- Ensure producer and consumer share the same manifest.schemaVersion.
- 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
- Before iterating, diff manifest filePaths against the zip's actual entries.
- Normalize path separators when reading bundles produced on Windows.
- Version-check manifest.schemaVersion to avoid producer/consumer mismatch.
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
- Failed to create ZIP file: ${error instanceof Error ? error.
- No valid files found in storage for ZIP download
- No pricing data returned
- No billing portal URL returned
- policy produced no output
AI-assisted analysis of Stirling-Tools/Stirling-PDF@9ef20dcab8 (2026-08-13).
Data as JSON: /api/errors/59bf667c53f316d2.
Report an issue: GitHub.