{"record":{"id":"d3b9e5cc456fdb56","repo":"cube-js/cube","slug":"transport-does-not-support-streaming","errorCode":null,"errorMessage":"Transport does not support streaming","messagePattern":"Transport does not support streaming","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-client-core/src/index.ts","lineNumber":881,"sourceCode":"\n        return {\n          schema: parsedSchema.schema,\n          data: rows,\n          ...(parsedSchema.lastRefreshTime ? { lastRefreshTime: parsedSchema.lastRefreshTime } : {}),\n        };\n      },\n      options,\n      callback\n    );\n  }\n\n  /**\n   * Execute a Cube SQL query against Cube SQL interface and return streaming results as an async generator.\n   * The server returns JSONL (JSON Lines) format with schema first, then data rows.\n   */\n  public async* cubeSqlStream(sqlQuery: string, options?: CubeSqlOptions): AsyncGenerator<CubeSqlStreamChunk> {\n    if (!this.transport.requestStream) {\n      throw new Error('Transport does not support streaming');\n    }\n\n    const streamResponse = this.transport.requestStream('cubesql', {\n      method: 'POST',\n      signal: options?.signal,\n      fetchTimeout: options?.timeout,\n      baseRequestId: uuidv4(),\n      params: {\n        query: sqlQuery,\n        cache: options?.cache,\n        timezone: options?.timezone,\n      }\n    });\n\n    const decoder = new TextDecoder();\n    let buffer = '';\n\n    try {","sourceCodeStart":863,"sourceCodeEnd":899,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-client-core/src/index.ts#L863-L899","documentation":"cubeSqlStream() requires a transport implementing requestStream(). If the transport lacks it (e.g. plain HttpTransport without streaming support), the method throws immediately since JSONL streaming cannot be performed.","triggerScenarios":"Calling cubeSqlStream() with a custom/legacy transport object that only implements request(), or an outdated HttpTransport version without requestStream.","commonSituations":"Using an older cubejs-client-core/transport version predating streaming; passing a hand-rolled fetch wrapper as transport; mocking transports in tests without requestStream.","solutions":["Use the built-in HttpTransport (or WebSocketTransport if supported) from a current cubejs-client-core version","Upgrade cubejs-client-core and related packages to a version whose transports support requestStream","If using a custom transport, implement requestStream(method, params) returning { subscribe, unsubscribe }","Use non-streaming cubeSql() if streaming is not required"],"exampleFix":"// before\nconst client = new CubejsClient({ apiUrl, transport: { request: (m, p) => fetch(...) } });\nawait client.cubeSqlStream(sql);\n// after\nimport { HttpTransport } from '@cubejs-client/core';\nconst transport = new HttpTransport({ authorization: token, apiUrl });\nconst client = new CubejsClient({ apiUrl, transport });\nawait client.cubeSqlStream(sql);","handlingStrategy":"validation","validationCode":"if (typeof client.transport?.requestStream !== 'function') {\n  throw new Error('Transport lacks streaming support; use HttpTransport from @cubejs-client/core');\n}","typeGuard":"function supportsStreaming(transport) {\n  return !!transport && typeof transport.requestStream === 'function';\n}","tryCatchPattern":"try { const stream = client.cubeSqlStream(sql); } catch (e) {\n  if (e.message === 'Transport does not support streaming') {\n    const res = await client.cubeSql(sql); // fallback to non-streaming\n  } else throw e;\n}","preventionTips":["Feature-check transport.requestStream before using streaming APIs","Upgrade transports to versions supporting requestStream","Mock requestStream in tests when stubbing transports"],"tags":["cubesql","streaming","transport"],"backgroundTag":"missing-capability","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}