Budibase/budibase · error · HTTPError
Project package is missing dependency-index.json.
Error message
Project package is missing dependency-index.json.
What it means
Project packages must include a dependency-index.json at the archive root. extractProjectPackage() verifies it via fsp.access in the Promise.all at imports.ts:966-982 and throws this HTTP 400 at imports.ts:975-979 when the file is absent. The dependency index records the project's dependency versions needed to reconstruct the environment.
Source
Thrown at packages/server/src/sdk/workspace/projects/backups/imports.ts:976
)
) {
throw new HTTPError("Project package contains unsupported files.", 400)
}
const manifestPath = join(tmpPath, PROJECT_MANIFEST_FILE)
const projectPath = join(tmpPath, PROJECT_FILE)
const dependencyIndexPath = join(tmpPath, PROJECT_DEPENDENCY_INDEX_FILE)
const docsPath = join(tmpPath, PROJECT_DOCS_DIRECTORY)
await Promise.all([
fsp.access(manifestPath).catch(() => {
throw new HTTPError("Project package is missing manifest.json.", 400)
}),
fsp.access(projectPath).catch(() => {
throw new HTTPError("Project package is missing project.json.", 400)
}),
fsp.access(dependencyIndexPath).catch(() => {
throw new HTTPError(
"Project package is missing dependency-index.json.",
400
)
}),
])
const [manifest, project, dependencyIndex] = await Promise.all([
readJsonFile<ProjectPackageManifest>(manifestPath),
readJsonFile<Project>(projectPath),
readJsonFile<ProjectPackageDependencyIndex>(dependencyIndexPath),
])
validateManifest(manifest)
validateProject(project)
validateDependencyIndexShape(dependencyIndex)
const docFiles = await fsp
.access(docsPath)View on GitHub (pinned to a81a902e9a)
Solutions
- Re-export the project package from the source workspace so dependency-index.json is generated
- Confirm the archive root contains dependency-index.json (tar -tf pkg.tgz | grep dependency-index)
- If re-zipping manually, include dependency-index.json exactly as exported
- Re-download/re-create the package if the original archive was truncated
Defensive patterns
Strategy: validation
Validate before calling
import { createReadStream } from 'fs'
import { parse } from 'tar'
const hasDepIndex = await new Promise<boolean>((resolve, reject) => {
const ws = parse({ onReadEntry: (e: any) => { if (e.path === 'dependency-index.json') { resolve(true); ws.abort?.() } }, onEnd: () => resolve(false) })
createReadStream(packagePath).pipe(ws as any)
ws.on('error', reject)
})
if (!hasDepIndex) throw new Error('package is missing dependency-index.json at archive root') Type guard
function hasDependencyIndex(entries: readonly string[]): entries is readonly string[] {
return entries.includes('dependency-index.json')
} Try / catch
try {
await importProjectPackage(file)
} catch (err) {
if (err instanceof HTTPError && err.status === 400 && err.message === 'Project package is missing dependency-index.json.') {
// re-export the package so the dependency index is generated
} else {
throw err
}
} Prevention
- Never prune dependency-index.json when slimming a package
- Validate all three required root files (manifest, project, dependency-index) before import
- Use current Budibase versions for exports so the index is always written
- Verify archive completeness after download before importing
When it happens
Trigger: Importing a package tarball whose root lacks dependency-index.json — the fsp.access(dependencyIndexPath) check rejects and throws this HTTP 400.
Common situations: Hand-assembling or pruning a package and removing dependency-index.json; importing archives produced by tools/versions that never wrote this file; truncated or corrupted tarballs.
Related errors
- Project package is missing manifest.json.
- Project package is missing project.json.
- Project package is too large.
- Unsupported Project doc path '${relPath}'.
- Project package contains a doc without an id.
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/c259e60acf19ae73.
Report an issue: GitHub.