cube-js/cube · error · UserError

Not full member name provided: ${path[0]}

Error message

Not full member name provided: ${path[0]}

What it means

memberShortNameFromPath expects a fully qualified member path of at least two segments (cube.member) because it returns the last two segments joined by a dot. A single-segment input cannot be split into cube and member, so a UserError is thrown.

Source

Thrown at packages/cubejs-schema-compiler/src/compiler/CubeEvaluator.ts:1030

  public dimensionByPath(dimensionPath: string | string[]): DimensionDefinition {
    return this.byPath('dimensions', dimensionPath) as DimensionDefinition;
  }

  public segmentByPath(segmentPath: string | string[]): SegmentDefinition {
    return this.byPath('segments', segmentPath) as SegmentDefinition;
  }

  public cubeExists(cube: string): boolean {
    return !!this.evaluatedCubes[cube];
  }

  public memberShortNameFromPath(path: string | string[]): string {
    if (!Array.isArray(path)) {
      path = path.split('.');
    }

    if (path.length < 2) {
      throw new UserError(`Not full member name provided: ${path[0]}`);
    }

    return path.slice(-2).join('.');
  }

  public cubeFromPath(path: string): EvaluatedCube {
    return this.evaluatedCubes[this.cubeNameFromPath(path)];
  }

  public cubeNameFromPath(path: string) {
    const cubeAndName = path.split('.');
    if (!this.evaluatedCubes[cubeAndName[0]]) {
      throw new UserError(`Cube '${cubeAndName[0]}' not found for path '${path}'`);
    }
    return cubeAndName[0];
  }

  public isInstanceOfType(type: 'measures' | 'dimensions' | 'segments', path: string | string[]): boolean {

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Qualify the member with its cube name before passing it ('Orders.region' instead of 'region')
  2. In client code, resolve the cube from the query context before constructing member paths
  3. Validate/normalize incoming member paths (reject single-segment names early)

Example fix

// before
evaluator.memberShortNameFromPath('totalAmount');
// after
evaluator.memberShortNameFromPath('Orders.totalAmount');
Defensive patterns

Strategy: type-guard

Validate before calling

if (typeof path === 'string' ? path.split('.').length < 2 : path.length < 2) throw new Error('Member must be cube-qualified: Cube.member');

Type guard

function isFullMemberPath(p) { return (typeof p === 'string' ? p.split('.') : p).length >= 2; }

Try / catch

try { return evaluator.memberShortNameFromPath(path); } catch (e) { if (e.message.startsWith('Not full member name')) { path = defaultCube + '.' + path; return evaluator.memberShortNameFromPath(path); } throw e; }

Prevention

When it happens

Trigger: Calling memberShortNameFromPath('region') or memberShortNameFromPath(['region']) — any path with fewer than 2 dot-separated segments.

Common situations: Users submitting queries with unqualified member names; client code forgetting to prefix cube name; filters/measures built from user input lacking the cube prefix.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/dd6b2bbe07456ab5. Report an issue: GitHub.