{"record":{"id":"47647986980c2748","repo":"cube-js/cube","slug":"root-package-not-found","errorCode":null,"errorMessage":"root package not found","messagePattern":"root package not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-templates/src/DependencyTree.ts","lineNumber":39,"sourceCode":"    if (diff.length) {\n      throw new Error(`The following packages could not be resolved: ${diff.join(', ')}`);\n    }\n  }\n\n  protected packages() {\n    return <Package[]> this.manifest.packages;\n  }\n\n  public getRootNode() {\n    if (this.rootNode) {\n      return this.rootNode;\n    }\n\n    const rootPackages = this.packages().filter((pkg) => pkg.installsTo == null);\n    const root = rootPackages.find((pkg) => this.templatePackages.includes(pkg.name));\n\n    if (!root) {\n      throw new Error('root package not found');\n    }\n\n    this.resolved.push(root.name);\n\n    this.rootNode = {\n      package: root,\n      children: [],\n    };\n\n    return this.rootNode;\n  }\n\n  protected packagesInstalledTo(name): Record<string, unknown> {\n    return indexByName(this.packages().filter((pkg) => (pkg.installsTo || {})[name]));\n  }\n\n  protected getChildren(pkg): any[] {\n    const children: any[] = [];","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-templates/src/DependencyTree.ts#L21-L57","documentation":"Thrown in DependencyTree.getRootNode when no package in the manifest qualifies as the root: a root must have installsTo == null and be one of the requested templatePackages. If the manifest is missing such a package, the dependency tree cannot be traversed from a top-level entry point.","triggerScenarios":"Thrown at packages/cubejs-templates/src/DependencyTree.ts:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the template manifest contains a package whose installsTo is null and whose name appears in templatePackages.","Check that at least one of the requested packages is an entry-point (base) package of the template.","Regenerate or repair the template manifest if packages data is corrupted or empty."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}