linshenkx/prompt-optimizer · error · Error
app backup package is missing manifest.json
Error message
app backup package is missing manifest.json
What it means
Thrown by readDataManagerResourcePackage in packages/ui/src/utils/data-manager-resource-package.ts after unzipSync when the zip archive contains no entry named 'manifest.json'. The reader treats manifest.json as the mandatory index of an app backup package, so an archive without it is rejected immediately. This fires before any content parsing occurs.
Source
Thrown at packages/ui/src/utils/data-manager-resource-package.ts:290
}
}
export const readDataManagerResourcePackage = (
input: ArrayBuffer | Uint8Array,
): {
manifest: DataManagerResourcePackageManifest
appDataJson: string
favoritesJson: string
files: Record<string, Uint8Array>
} => {
const bytes = input instanceof Uint8Array ? input : new Uint8Array(input)
const files = unzipSync(bytes)
const manifestBytes = files['manifest.json']
const appDataBytes = files[APP_DATA_JSON_PATH]
const favoritesBytes = files[FAVORITES_JSON_PATH]
if (!manifestBytes) {
throw new Error('app backup package is missing manifest.json')
}
if (!appDataBytes) {
throw new Error('app backup package is missing app-data.json')
}
if (!favoritesBytes) {
throw new Error('app backup package is missing favorites.json')
}
return {
manifest: parseManifest(strFromU8(manifestBytes)),
appDataJson: strFromU8(appDataBytes),
favoritesJson: strFromU8(favoritesBytes),
files,
}
}
const getImportStorageService = (
store: DataManagerImageStoreKey,View on GitHub (pinned to 3e677b1d9f)
Solutions
- Confirm you selected the actual exported .app backup package, not an arbitrary zip
- List the zip entries and verify 'manifest.json' exists at the archive root (no directory prefix, exact lowercase name)
- If the manifest is nested, re-zip the contents so manifest.json is at the top level, or extract-and-repackage via the app's exporter
- Validate the file before calling the API (see validation code) so users get a friendly message
Example fix
// before
const pkg = readDataManagerResourcePackage(bytes) // throws: missing manifest.json
// after
const entries = Object.keys(unzipSync(bytes))
if (!entries.includes('manifest.json')) {
throw new Error(`Not an app backup package; expected manifest.json, found: ${entries.join(', ')}`)
}
const pkg = readDataManagerResourcePackage(bytes) Defensive patterns
Strategy: validation
Validate before calling
import { unzipSync } from 'fflate'
const looksLikeAppBackup = (bytes: Uint8Array): boolean => {
try {
return 'manifest.json' in unzipSync(bytes)
} catch {
return false // not a zip at all
}
}
if (!looksLikeAppBackup(bytes)) {
// reject file in the picker before calling readDataManagerResourcePackage
} Try / catch
try {
const pkg = readDataManagerResourcePackage(bytes)
} catch (e) {
if (e instanceof Error && e.message.includes('missing manifest.json')) {
showFileError('Selected file is not an app backup package')
return
}
throw e
} Prevention
- Accept only .zip/.backup files produced by the app's export in the file picker
- Validate zip entries before invoking the reader
- Restrict file-picker extensions and show the expected format in the UI
- Log the zip's entry list on failure to speed up diagnosis
When it happens
Trigger: Passing a Uint8Array/ArrayBuffer zip that lacks a top-level 'manifest.json' entry: e.g. a random zip file, a zip whose manifest sits in a subdirectory (e.g. backup/manifest.json), or a zip built with a different entry name or casing (Manifest.json). Note unzipSync on non-zip bytes would throw its own error first, so this specifically means a valid zip without that entry.
Common situations: User picks the wrong file in a restore file-picker; a repackaged/re-zipped backup lost the top-level manifest; tooling that re-zips with folder prefixes; case-sensitive filesystems or zip tools that rename entries.
Related errors
- Invalid app backup package manifest
- app backup package is missing app-data.json
- app backup package is missing favorites.json
- favorites package is missing manifest.json
- Invalid favorites package manifest
AI-assisted analysis of linshenkx/prompt-optimizer@3e677b1d9f (2026-08-27).
Data as JSON: /api/errors/5a8a30b9bdda4777.
Report an issue: GitHub.