{"record":{"id":"178b1ebe1bc42d16","repo":"cube-js/cube","slug":"path-can-t-be-undefined","errorCode":null,"errorMessage":"Path can't be undefined","messagePattern":"Path can't be undefined","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts","lineNumber":1076,"sourceCode":"\n    if (this.isInstanceOfType('dimensions', path)) {\n      return this.byPath('dimensions', path);\n    }\n\n    if (this.isInstanceOfType('segments', path)) {\n      return this.byPath('segments', path);\n    }\n\n    throw new UserError(`Can't resolve member '${Array.isArray(path) ? path.join('.') : path}'`);\n  }\n\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","sourceCodeStart":1058,"sourceCodeEnd":1094,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts#L1058-L1094","documentation":"The paired guard in CubeEvaluator.byPath: the member path argument was falsy (undefined/empty) when resolving a typed member. A path must be a 'cubeName.memberName' string or [cube, name] array; an empty path means a caller passed unpopulated resolution state. Internal guard — indicates a bug in the calling compiler code rather than invalid user schema. The input at fault is an undefined/empty `path`.","triggerScenarios":"Thrown at packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts:1076 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid member path string or [cube, member] array to byPath","Fix callers that destructure or resolve paths and may yield undefined","Guard path construction (e.g. optional chained member names) before calling the evaluator"],"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"}