{"record":{"id":"9dfaeeabef546a5a","repo":"cube-js/cube","slug":"type-not-defined-for-path-path","errorCode":null,"errorMessage":"${type} not defined for path '${path}'","messagePattern":"(.+?) not defined for path '(.+?)'","errorType":"validation","errorClass":"UserError","httpStatus":null,"severity":"error","filePath":"packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts","lineNumber":1087,"sourceCode":"\n  public byPath<T extends 'measures' | 'dimensions' | 'segments' | 'preAggregations'>(type: T, path: string | string[]): EvaluatedCube[T][string] {\n    if (!type) {\n      throw new Error(`Type can't be undefined for '${path}'`);\n    }\n\n    if (!path) {\n      throw new Error('Path can\\'t be undefined');\n    }\n\n    const cubeAndName = Array.isArray(path) ? path : path.split('.');\n    const cube = this.evaluatedCubes[cubeAndName[0]];\n    if (cube === undefined) {\n      throw new UserError(`Cube '${cubeAndName[0]}' not found for path '${path}'`);\n    }\n\n    const typeMembers = cube[type];\n    if (typeMembers === undefined) {\n      throw new UserError(`${type} not defined for path '${path}'`);\n    }\n\n    const member = typeMembers[cubeAndName[1]];\n    if (member === undefined) {\n      throw new UserError(`'${cubeAndName[1]}' not found for path '${path}'`);\n    }\n\n    return member as EvaluatedCube[T][string];\n  }\n\n  public parsePath(type: 'measures' | 'dimensions' | 'segments' | 'preAggregations', path: string): string[] {\n    // Should throw UserError in case of parse error\n    this.byPath(type, path);\n    return path.split('.');\n  }\n\n  public isRbacEnabledForCube(cube: any): boolean {\n    return cube.accessPolicy?.length;","sourceCodeStart":1069,"sourceCodeEnd":1105,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts#L1069-L1105","documentation":"A UserError in CubeEvaluator.byPath: the cube portion of the member path resolved, but the cube object has no members collection for the requested type — i.e. the member path was looked up under a category (measures/dimensions/segments/preAggregations) the cube does not define. Typical cause is a typo'd member reference or querying a member of the wrong category (e.g. treating a dimension as a measure). The input at fault is a type+path pair whose cube lacks that member category.","triggerScenarios":"Thrown at packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts:1087 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Request an existing member type for the cube: measures, dimensions, segments, or preAggregations","Check the cube name in the path is correct — the cube resolved but lacks the requested member category","Use byPathAnyType when the member category is not known in advance"],"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"}