cube-js/cube · error
Parameter with type: object is not supported
Error message
Parameter with type: object is not supported
What it means
serializeParameter converts JS query parameters into flatbuffer HttpParameter values; plain JS objects are not a representable wire type, so the driver throws. Parameters must be string, number, boolean, or binary.
Source
Thrown at packages/cubejs-cubestore-driver/src/WebSocketConnection.ts:483
HttpParameterValue.NullValue,
httpParameterValueOffset
);
}
switch (typeof parameter) {
case 'object':
{
if (Buffer.isBuffer(parameter)) {
const valueOffset = BinaryValue.createVVector(builder, parameter);
const httpParameterValueOffset = BinaryValue.createBinaryValue(builder, valueOffset);
return HttpParameter.createHttpParameter(
builder,
HttpParameterValue.BinaryValue,
httpParameterValueOffset
);
} else {
throw new Error('Parameter with type: object is not supported');
}
}
case 'boolean':
{
const httpParameterValueOffset = BoolValue.createBoolValue(
builder,
parameter
);
return HttpParameter.createHttpParameter(
builder,
HttpParameterValue.BoolValue,
httpParameterValueOffset
);
}
case 'number':
{
if (Number.isInteger(parameter)) {View on GitHub (pinned to 7d981676b3)
Solutions
- Serialize the object to a JSON string before passing it
- Primitives: expand arrays into individual placeholders (?,?,?)
- Convert Date to an ISO string
- Pre-validate parameter types before calling query()
Example fix
// before
driver.query('SELECT * FROM t WHERE id IN (?)', [[1,2,3]]);
// after
driver.query('SELECT * FROM t WHERE id IN (?, ?, ?)', [1, 2, 3]); Defensive patterns
Strategy: type-guard
Validate before calling
function assertSupportedParams(params) {
params.forEach((p, i) => {
if (Array.isArray(p)) throw new Error(`param ${i}: expand arrays into individual placeholders`);
if (p !== null && p !== undefined && typeof p === 'object' && !isBinaryParam(p)) {
throw new Error(`param ${i}: serialize object to JSON string first`);
}
});
} Type guard
const isSerializableParam = (p) => ['string', 'number', 'boolean'].includes(typeof p) || p == null || isBinaryParam(p);
Try / catch
try {
return await driver.query(sql, params);
} catch (e) {
if (/Parameter with type: object is not supported/.test(e.message)) {
return driver.query(sql, params.map(p =>
(p && typeof p === 'object' && !isBinaryParam(p)) ? JSON.stringify(p) : p));
}
throw e;
} Prevention
- Never pass arrays as a single parameter; expand IN-clause placeholders
- Convert Date objects to ISO strings before passing
- Wrap complex values with JSON.stringify explicitly
- Unit-test query helpers with the actual parameter shapes you send
When it happens
Trigger: Passing a JavaScript object (e.g. an array, Date, or nested object) as a query parameter to driver.query() against Cube Store.
Common situations: Passing an array for an IN clause instead of expanding placeholders; passing Date objects or JSON blobs unserialized; ORM-built parameter objects.
Related errors
- Parameter with type: ${typeof parameter} is not supported
- Unsupported table data passed to ${this.constructor}
- Unable to import (as rows) in Cube Store: empty columns. Mos
- Unable to import (as csv) in Cube Store: empty columns. Most
- Unable to import (as stream) in Cube Store: empty columns. M
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/015a82baed9587ac.
Report an issue: GitHub.