cube-js/cube · warning

Option hearBeatInterval is deprecated. It was replaced by he

Error message

Option hearBeatInterval is deprecated. It was replaced by heartBeatInterval.

What it means

A deprecation warning from the WebSocket transport constructor: the misspelled option hearBeatInterval was passed instead of heartBeatInterval. The misspelled key is still read as a fallback so existing integrations keep working, but the constructor flags the typo so callers migrate to the corrected name.

Source

Thrown at packages/cubejs-client-ws-transport/src/index.ts:72

  protected token: string | undefined;

  protected ws: any = null;

  protected messageCounter: number = 1;

  protected messageIdToSubscription: Record<number, Subscription> = {};

  protected messageQueue: Message[] = [];

  public constructor({ authorization, apiUrl, heartBeatInterval, hearBeatInterval }: WebSocketTransportOptions) {
    this.token = authorization;
    this.apiUrl = apiUrl;

    if (heartBeatInterval) {
      this.heartBeatInterval = heartBeatInterval;
    } else if (hearBeatInterval) {
      console.warn('Option hearBeatInterval is deprecated. It was replaced by heartBeatInterval.');
      this.heartBeatInterval = hearBeatInterval;
    }
  }

  public set authorization(token) {
    this.token = token;

    if (this.ws) {
      this.ws.close();
    }
  }

  public async close(): Promise<void> {
    if (this.ws) {
      // Flush send queue before sending close frame
      this.ws.sendQueue();

      this.ws.close();

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Rename the option to heartBeatInterval in the transport constructor options
  2. Type the options object as WebSocketTransportOptions so typos are caught at compile time
  3. Search the codebase for hearBeatInterval to remove all occurrences

Example fix

// before
new WebSocketTransport({ apiUrl: url, hearBeatInterval: 30000 });
// after
new WebSocketTransport({ apiUrl: url, heartBeatInterval: 30000 });
Defensive patterns

Strategy: validation

Validate before calling

if ('hearBeatInterval' in opts) console.warn('Rename hearBeatInterval -> heartBeatInterval');

Type guard

function isTransportOptions(o: object): o is { heartBeatInterval?: number } {
  return !('hearBeatInterval' in o);
}

Prevention

When it happens

Trigger: new WebSocketTransport({ ..., hearBeatInterval: n }) without heartBeatInterval, or after heartBeatInterval, hits the else-if branch and warns.

Common situations: Older code/configs written against the misspelled option; copied examples from pre-rename docs; TS types may not flag it if options were passed loosely.

Related errors


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