{"record":{"id":"c259e60acf19ae73","repo":"Budibase/budibase","slug":"project-package-is-missing-dependency-index-json","errorCode":null,"errorMessage":"Project package is missing dependency-index.json.","messagePattern":"Project package is missing dependency-index\\.json\\.","errorType":"validation","errorClass":"HTTPError","httpStatus":400,"severity":"error","filePath":"packages/server/src/sdk/workspace/projects/backups/imports.ts","lineNumber":976,"sourceCode":"      )\n    ) {\n      throw new HTTPError(\"Project package contains unsupported files.\", 400)\n    }\n\n    const manifestPath = join(tmpPath, PROJECT_MANIFEST_FILE)\n    const projectPath = join(tmpPath, PROJECT_FILE)\n    const dependencyIndexPath = join(tmpPath, PROJECT_DEPENDENCY_INDEX_FILE)\n    const docsPath = join(tmpPath, PROJECT_DOCS_DIRECTORY)\n\n    await Promise.all([\n      fsp.access(manifestPath).catch(() => {\n        throw new HTTPError(\"Project package is missing manifest.json.\", 400)\n      }),\n      fsp.access(projectPath).catch(() => {\n        throw new HTTPError(\"Project package is missing project.json.\", 400)\n      }),\n      fsp.access(dependencyIndexPath).catch(() => {\n        throw new HTTPError(\n          \"Project package is missing dependency-index.json.\",\n          400\n        )\n      }),\n    ])\n\n    const [manifest, project, dependencyIndex] = await Promise.all([\n      readJsonFile<ProjectPackageManifest>(manifestPath),\n      readJsonFile<Project>(projectPath),\n      readJsonFile<ProjectPackageDependencyIndex>(dependencyIndexPath),\n    ])\n\n    validateManifest(manifest)\n    validateProject(project)\n    validateDependencyIndexShape(dependencyIndex)\n\n    const docFiles = await fsp\n      .access(docsPath)","sourceCodeStart":958,"sourceCodeEnd":994,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/projects/backups/imports.ts#L958-L994","documentation":"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.","triggerScenarios":"Importing a package tarball whose root lacks dependency-index.json — the fsp.access(dependencyIndexPath) check rejects and throws this HTTP 400.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { createReadStream } from 'fs'\nimport { parse } from 'tar'\nconst hasDepIndex = await new Promise<boolean>((resolve, reject) => {\n  const ws = parse({ onReadEntry: (e: any) => { if (e.path === 'dependency-index.json') { resolve(true); ws.abort?.() } }, onEnd: () => resolve(false) })\n  createReadStream(packagePath).pipe(ws as any)\n  ws.on('error', reject)\n})\nif (!hasDepIndex) throw new Error('package is missing dependency-index.json at archive root')","typeGuard":"function hasDependencyIndex(entries: readonly string[]): entries is readonly string[] {\n  return entries.includes('dependency-index.json')\n}","tryCatchPattern":"try {\n  await importProjectPackage(file)\n} catch (err) {\n  if (err instanceof HTTPError && err.status === 400 && err.message === 'Project package is missing dependency-index.json.') {\n    // re-export the package so the dependency index is generated\n  } else {\n    throw err\n  }\n}","preventionTips":["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"],"tags":["import","missing-file","http-400"],"backgroundTag":"missing-package-manifest","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}