fix(actions): use CubeApi (renamed from CubejsApi) in @cubejs-client/core 1.x#62
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hotfix for a regression from #61. The Cube.js 1.6.68 client renamed the API class
CubejsApi→CubeApiand moved to ESM named exports, soconst { CubejsApi } = cubejsClientCorebecameundefinedandnew CubejsApiClient(...)threwCubejsApiClient is not a constructor— breaking everyrun_query/run_sqlpath 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
CubeApiis a constructor;new CubeApi(token, {apiUrl, headers})works;.meta/.sql/.loadpresentcubejsApi.jsmodule loads without throwingWhy 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