Skip to content

fix(actions): use CubeApi (renamed from CubejsApi) in @cubejs-client/core 1.x#62

Merged
acmeguy merged 1 commit into
mainfrom
fix/actions-cube-client-cubeapi-rename
Jul 7, 2026
Merged

fix(actions): use CubeApi (renamed from CubejsApi) in @cubejs-client/core 1.x#62
acmeguy merged 1 commit into
mainfrom
fix/actions-cube-client-cubeapi-rename

Conversation

@acmeguy

@acmeguy acmeguy commented Jul 7, 2026

Copy link
Copy Markdown

Hotfix for a regression from #61. The Cube.js 1.6.68 client renamed the API class CubejsApiCubeApi and moved to ESM named exports, so const { CubejsApi } = cubejsClientCore became undefined and new CubejsApiClient(...) threw CubejsApiClient is not a constructor — breaking every run_query/run_sql path through the actions service (client-v2 showed [GraphQL] CubejsApiClient is not a constructor).

Fix

Named import of the renamed class: import { CubeApi as CubejsApiClient } from "@cubejs-client/core". Constructor signature and .meta()/.sql()/.load() are unchanged.

Verified in a 1.6.68 image

  • CubeApi is a constructor; new CubeApi(token, {apiUrl, headers}) works; .meta/.sql/.load present
  • The real cubejsApi.js module loads without throwing

Why unit tests missed it

The actions suite never constructs the client at runtime, so the import-interop break only surfaced on a live query.

🤖 Generated with Claude Code

…core 1.x

The 1.6.68 client (#61) renamed the API class CubejsApi → CubeApi and
switched to ESM named exports, so `const { CubejsApi } = cubejsClientCore`
resolved to undefined and `new CubejsApiClient(...)` threw
"CubejsApiClient is not a constructor" — breaking every run_query /
run_sql path through the actions service (client-v2 GraphQL errors).

Import the class by its new name via a named import; constructor
signature and .meta()/.sql()/.load() are unchanged. Verified in a
1.6.68 image: constructor + methods present, cubejsApi.js loads clean.

Missed by unit tests because they never construct the client at runtime.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@acmeguy acmeguy merged commit 952965c into main Jul 7, 2026
1 check passed
@acmeguy acmeguy deleted the fix/actions-cube-client-cubeapi-rename branch July 7, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant