{"record":{"id":"34417e4c04774bcf","repo":"cube-js/cube","slug":"cube-cubeandname-0-not-found-for-path-pat","errorCode":null,"errorMessage":"Cube '${cubeAndName[0]}' not found for path '${path}'","messagePattern":"Cube '(.+?)' not found for path '(.+?)'","errorType":"validation","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts","lineNumber":1043,"sourceCode":"    if (!Array.isArray(path)) {\n      path = path.split('.');\n    }\n\n    if (path.length < 2) {\n      throw new UserError(`Not full member name provided: ${path[0]}`);\n    }\n\n    return path.slice(-2).join('.');\n  }\n\n  public cubeFromPath(path: string): EvaluatedCube {\n    return this.evaluatedCubes[this.cubeNameFromPath(path)];\n  }\n\n  public cubeNameFromPath(path: string) {\n    const cubeAndName = path.split('.');\n    if (!this.evaluatedCubes[cubeAndName[0]]) {\n      throw new UserError(`Cube '${cubeAndName[0]}' not found for path '${path}'`);\n    }\n    return cubeAndName[0];\n  }\n\n  public isInstanceOfType(type: 'measures' | 'dimensions' | 'segments', path: string | string[]): boolean {\n    const cubeAndName = Array.isArray(path) ? path : path.split('.');\n    const symbol = this.evaluatedCubes[cubeAndName[0]]?.[type]?.[cubeAndName[1]];\n    return symbol !== undefined;\n  }\n\n  public byPathAnyType(path: string | string[]) {\n    if (this.isInstanceOfType('measures', path)) {\n      return this.byPath('measures', path);\n    }\n\n    if (this.isInstanceOfType('dimensions', path)) {\n      return this.byPath('dimensions', path);\n    }","sourceCodeStart":1025,"sourceCodeEnd":1061,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts#L1025-L1061","documentation":"cubeNameFromPath splits a member path on '.' and verifies the first segment is a known cube in evaluatedCubes. If the cube part of the path isn't found (typo, not compiled, or removed), a UserError naming the cube and full path is thrown.","triggerScenarios":"Calling cubeNameFromPath('Oders.totalAmount') or byPath/memberFromPath with a path whose first segment doesn't match any evaluated cube.","commonSituations":"Misspelled cube names in queries; querying a cube that failed to compile; referring to a view/cube from a different tenant/schema that wasn't loaded; case mismatch.","solutions":["Correct the cube name in the path to match the schema declaration exactly","Ensure the schema containing the cube compiles and is loaded into the evaluator","Check for casing/tenant-specific schema loading issues"],"exampleFix":"// before\nevaluator.cubeNameFromPath('Oders.totalAmount');\n// after\nevaluator.cubeNameFromPath('Orders.totalAmount');","handlingStrategy":"validation","validationCode":"const cubeName = path.split('.')[0];\nif (!evaluator.cubeNames().includes(cubeName)) throw new Error(`Unknown cube '${cubeName}' in path '${path}'`);","typeGuard":null,"tryCatchPattern":"try { return evaluator.cubeNameFromPath(path); } catch (e) { if (e.message.includes(\"not found for path\")) { /* show available cubes */ } throw e; }","preventionTips":["Derive cube names from compiled schema output","Keep query clients in sync with schema renames","Validate query member paths before execution"],"tags":["cube","path","validation"],"backgroundTag":"undefined-cube","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}