Budibase/budibase · error · HTTPError
Project package docs do not match dependency-index.json.
Error message
Project package docs do not match dependency-index.json.
What it means
The dependency index must contain an entry for the root project itself in its resources map (imports.ts:748-753). If dependencyIndex.resources[rootProjectId] is absent, the package's docs cannot be reconciled with the index, so import fails with 400. The same message is reused later at imports.ts:801 for directMembers whose docs are missing.
Source
Thrown at packages/server/src/sdk/workspace/projects/backups/imports.ts:749
docs: ImportedDoc[],
manifest: ProjectPackageManifest
) => {
if (dependencyIndex.rootProjectId !== project._id) {
throw new HTTPError(
"Project package dependency index does not match project.json.",
400
)
}
const actualDocIds = new Set(docs.map(doc => doc.doc._id!))
const expectedDocIds = new Set(
Object.keys(dependencyIndex.resources).filter(
id => id !== dependencyIndex.rootProjectId
)
)
if (!dependencyIndex.resources[dependencyIndex.rootProjectId]) {
throw new HTTPError(
"Project package docs do not match dependency-index.json.",
400
)
}
for (const doc of docs) {
validateDocMatchesPath(doc)
if (!expectedDocIds.has(doc.doc._id!)) {
throw new HTTPError(
"Project package contains docs not listed in dependency-index.json.",
400
)
}
}
for (const expectedDocId of expectedDocIds) {
if (!actualDocIds.has(expectedDocId)) {
throw new HTTPError(View on GitHub (pinned to a81a902e9a)
Solutions
- Add a resources entry keyed by rootProjectId with the root project's dependencies list.
- Regenerate the package with the official export so the root project is always included in resources.
- Verify with `jq --arg r .rootProjectId '.resources | has($r)' dependency-index.json` — it must be true.
- If the project id was changed, update both rootProjectId and the resources keys consistently.
Example fix
// before
"resources": { "ta_1": { "dependencies": [] } }
// after (root project present)
"resources": { "app_abc": { "dependencies": [{ "id": "ta_1", "name": "Table", "type": "table" }] }, "ta_1": { "dependencies": [] } } Defensive patterns
Strategy: validation
Validate before calling
if (!pkg.dependencyIndex.resources[pkg.dependencyIndex.rootProjectId]) {
throw new Error("dependency-index.json must contain a resources entry for the root project")
} Try / catch
try {
await importProjectPackage(file)
} catch (e) {
if (e.status === 400 && e.message.includes("docs do not match dependency-index.json")) {
// verify the root project entry exists in resources before retrying
} else throw e
} Prevention
- Always include the root project itself as a key in resources
- If renaming the project id, update rootProjectId and resources keys together
- Run a pre-import check: resources must have the rootProjectId key
- Prefer regenerating the index over hand-editing it
When it happens
Trigger: Importing a package whose dependency-index.json resources map omits the key equal to rootProjectId — the root project entry was deleted, the index was generated only from members, or rootProjectId was renamed without updating resources.
Common situations: Hand-built dependency indexes listing only child resources; scripts that strip the project doc; renaming the project id in project.json without adding the new id as a key in resources.
Related errors
- Project package dependency index does not match project.json
- Project package contains docs not listed in dependency-index
- Project package dependency index references missing docs.
- Project package resource count mismatch for '${resourceType}
- Project package dependency index is invalid.
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/e22dbec2ceba3e09.
Report an issue: GitHub.